Skip to content

Commit d654182

Browse files
committed
commit example files
1 parent 7714f55 commit d654182

File tree

3 files changed

+37
-52
lines changed

3 files changed

+37
-52
lines changed

Cargo.toml

+12-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@ keywords = [
1313
"zero-knowledge"
1414
]
1515
categories = [ "compilers", "cryptography", "web-programming" ]
16-
include = [ "Cargo.toml", "leo", "README.md", "LICENSE.md" ]
16+
include = [
17+
"Cargo.toml",
18+
"leo",
19+
"README.md",
20+
"LICENSE.md",
21+
"examples/lottery/inputs/lottery.in",
22+
"examples/lottery/src/main.leo",
23+
"examples/tictactoe/inputs/tictactoe.in",
24+
"examples/tictactoe/src/main.leo",
25+
"examples/token/inputs/token.in",
26+
"examples/token/src/main.leo",
27+
]
1728
license = "GPL-3.0"
1829
edition = "2021"
1930

leo/cli/commands/example.rs

+25-9
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,41 @@ impl Example {
7878

7979
fn main_file_string(&self) -> String {
8080
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+
}
8490
}
8591
}
8692

8793
fn input_file_string(&self) -> String {
8894
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+
}
92104
}
93105
}
94106

95107
fn readme_file_string(&self) -> String {
96108
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(),
100116
}
101117
}
102118
}

leo/package/src/example.rs

-42
This file was deleted.

0 commit comments

Comments
 (0)