diff --git a/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs b/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs index 1316294909..ead4e1dd83 100644 --- a/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs +++ b/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs @@ -1,5 +1,3 @@ -use add_one; - fn main() { let num = 10; println!("Hello, world! {num} plus one is {}!", add_one::add_one(num)); diff --git a/src/ch14-03-cargo-workspaces.md b/src/ch14-03-cargo-workspaces.md index ccbae71463..feae08f65d 100644 --- a/src/ch14-03-cargo-workspaces.md +++ b/src/ch14-03-cargo-workspaces.md @@ -149,11 +149,10 @@ Cargo doesn’t assume that crates in a workspace will depend on each other, so we need to be explicit about the dependency relationships. Next, let’s use the `add_one` function (from the `add_one` crate) in the -`adder` crate. Open the _adder/src/main.rs_ file and add a `use` line at the -top to bring the new `add_one` library crate into scope. Then change the `main` +`adder` crate. Open the _adder/src/main.rs_ file and change the `main` function to call the `add_one` function, as in Listing 14-7. -+ ```rust,ignore {{#rustdoc_include ../listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs}}