Skip to content

Commit 48379f5

Browse files
authored
Add Cargo instructions to expression evaluator (#3112)
Our Cargo instructions has not mentioned the `--lib` flag yet, so add it here where it's needed for the first time.
1 parent 5e01948 commit 48379f5

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/pattern-matching/exercise.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,17 @@ the course. An expression can be "boxed" with `Box::new` as seen in the tests.
6565
To evaluate a boxed expression, use the deref operator (`*`) to "unbox" it:
6666
`eval(*boxed_expr)`.
6767

68-
Copy and paste the code into the Rust playground, and begin implementing `eval`.
69-
The final product should pass the tests. It may be helpful to use `todo!()` and
70-
get the tests to pass one-by-one. You can also skip a test temporarily with
71-
`#[ignore]`:
68+
Create a new Cargo library project with
69+
70+
```sh
71+
cargo new --lib evaluator
72+
```
73+
74+
Copy and paste the code below into a the `src/lib.rs` file.
75+
76+
Then begin implementing `eval`. Use `cargo test` to ensure that the final
77+
library passes the tests. It may be helpful to use `todo!()` and get the tests
78+
to pass one-by-one. You can also skip a test temporarily with `#[ignore]`:
7279

7380
```none
7481
#[test]

0 commit comments

Comments
 (0)