diff --git a/src/exercises/day-4/dining-philosophers.md b/src/exercises/day-4/dining-philosophers.md index 04387b36..9b864b5a 100644 --- a/src/exercises/day-4/dining-philosophers.md +++ b/src/exercises/day-4/dining-philosophers.md @@ -11,8 +11,10 @@ The dining philosophers problem is a classic problem in concurrency: > an individual philosopher finishes eating, they will put down both forks. You will need a local [Cargo installation](../../cargo/running-locally.md) for -this exercise. Copy the code below to `src/main.rs` file, fill out the blanks, -and test that `cargo run` does not deadlock: +this exercise. Copy the code below to a file called `src/main.rs`, fill out the +blanks, and test that `cargo run` does not deadlock: + + ```rust,compile_fail {{#include dining-philosophers.rs:Philosopher}} @@ -35,3 +37,14 @@ and test that `cargo run` does not deadlock: // Output their thoughts } ``` + +You can use the following `Cargo.toml`: + + + +```toml +[package] +name = "dining-philosophers" +version = "0.1.0" +edition = "2021" +``` diff --git a/src/exercises/day-4/link-checker.md b/src/exercises/day-4/link-checker.md index 9922c909..e4c50622 100644 --- a/src/exercises/day-4/link-checker.md +++ b/src/exercises/day-4/link-checker.md @@ -32,7 +32,14 @@ $ cargo add thiserror The `cargo add` calls will update the `Cargo.toml` file to look like this: + + ```toml +[package] +name = "link-checker" +version = "0.1.0" +edition = "2021" + [dependencies] reqwest = { version = "0.11.12", features = ["blocking", "rustls-tls"] } scraper = "0.13.0" @@ -44,6 +51,8 @@ You can now download the start page. Try with a small site such as Your `src/main.rs` file should look something like this: + + ```rust,compile_fail {{#include link-checker.rs:setup}}