diff --git a/src/ch01-03-hello-world.md b/src/ch01-03-hello-world.md index 703834177..302f8fd14 100644 --- a/src/ch01-03-hello-world.md +++ b/src/ch01-03-hello-world.md @@ -248,21 +248,26 @@ Inside this file, type the following information: ```toml [package] - name = "hello_world" version = "0.1.0" -authors = [ "Your name " ] +authors = ["Your name "] + +[dependencies] ``` The first line, `[package]`, indicates that the following statements are configuring a package. As we add more information to this file, we’ll add other sections, but for now, we just have the package configuration. -The other three lines set the three bits of configuration that Cargo needs to +The next three lines set the three bits of configuration that Cargo needs to know to compile your program: its name, what version it is, and who wrote it. +Cargo gets this information from your environment. If it’s not correct, go ahead +and fix that and save the file. -Once you've added this information to the *Cargo.toml* file, save it to finish -creating the configuration file. +The last line, `[dependencies]`, is the start of a section for you to list any +crates that your project will depend on, so that Cargo knows to download and +compile those too. We won't need any other crates for this project, but we will +in the guessing game tutorial in the next chapter. ## Building and Running a Cargo Project diff --git a/src/ch02-01-guessing-game-tutorial.md b/src/ch02-01-guessing-game-tutorial.md index 8e804de0c..090581047 100644 --- a/src/ch02-01-guessing-game-tutorial.md +++ b/src/ch02-01-guessing-game-tutorial.md @@ -29,10 +29,11 @@ Take a look at the generated `Cargo.toml`: ```toml [package] - name = "guessing_game" version = "0.1.0" authors = ["Your Name "] + +[dependencies] ``` Cargo gets this information from your environment. If it’s not correct, go ahead @@ -344,7 +345,8 @@ programs. Using external crates is where Cargo really shines. Before we can write the code using `rand`, we need to modify our `Cargo.toml`. Open it up, and -add these few lines at the bottom: +add this line at the bottom beneath the `[dependencies]` section header that +Cargo created for you: ```toml [dependencies]