@@ -78,25 +78,41 @@ impl Example {
78
78
79
79
fn main_file_string ( & self ) -> String {
80
80
match self {
81
- Self :: Lottery => include_str ! ( "../../../examples/lottery/src/main.leo" ) . to_string ( ) ,
82
- Self :: TicTacToe => include_str ! ( "../../../examples/tictactoe/src/main.leo" ) . to_string ( ) ,
83
- Self :: Token => include_str ! ( "../../../examples/token/src/main.leo" ) . to_string ( ) ,
81
+ Self :: Lottery => {
82
+ include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/lottery/src/main.leo" ) ) . to_string ( )
83
+ }
84
+ Self :: TicTacToe => {
85
+ include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/tictactoe/src/main.leo" ) ) . to_string ( )
86
+ }
87
+ Self :: Token => {
88
+ include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/token/src/main.leo" ) ) . to_string ( )
89
+ }
84
90
}
85
91
}
86
92
87
93
fn input_file_string ( & self ) -> String {
88
94
match self {
89
- Self :: Lottery => include_str ! ( "../../../examples/lottery/inputs/lottery.in" ) . to_string ( ) ,
90
- Self :: TicTacToe => include_str ! ( "../../../examples/tictactoe/inputs/tictactoe.in" ) . to_string ( ) ,
91
- Self :: Token => include_str ! ( "../../../examples/token/inputs/token.in" ) . to_string ( ) ,
95
+ Self :: Lottery => {
96
+ include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/lottery/inputs/lottery.in" ) ) . to_string ( )
97
+ }
98
+ Self :: TicTacToe => {
99
+ include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/tictactoe/inputs/tictactoe.in" ) ) . to_string ( )
100
+ }
101
+ Self :: Token => {
102
+ include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/token/inputs/token.in" ) ) . to_string ( )
103
+ }
92
104
}
93
105
}
94
106
95
107
fn readme_file_string ( & self ) -> String {
96
108
match self {
97
- Self :: Lottery => include_str ! ( "../../../examples/lottery/README.md" ) . to_string ( ) ,
98
- Self :: TicTacToe => include_str ! ( "../../../examples/tictactoe/README.md" ) . to_string ( ) ,
99
- Self :: Token => include_str ! ( "../../../examples/token/README.md" ) . to_string ( ) ,
109
+ Self :: Lottery => {
110
+ include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/lottery/README.md" ) ) . to_string ( )
111
+ }
112
+ Self :: TicTacToe => {
113
+ include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/tictactoe/README.md" ) ) . to_string ( )
114
+ }
115
+ Self :: Token => include_str ! ( concat!( env!( "CARGO_MANIFEST_DIR" ) , "/examples/token/README.md" ) ) . to_string ( ) ,
100
116
}
101
117
}
102
118
}
0 commit comments