Skip to content

Commit eecb53c

Browse files
authored
Merge pull request #1287 from stomar/cargo-dependencies
Improve Cargo / Dependencies section
2 parents bb1ecf1 + 11b26c8 commit eecb53c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cargo/deps.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ cargo new foo
1515
cargo new --lib foo
1616
```
1717

18-
For the rest of this chapter, I will assume we are making a binary, rather than
18+
For the rest of this chapter, let's assume we are making a binary, rather than
1919
a library, but all of the concepts are the same.
2020

21-
After the above commands, you should see something like this:
21+
After the above commands, you should see a file hierarchy like this:
2222

2323
```txt
2424
foo
@@ -40,7 +40,7 @@ authors = ["mark"]
4040
[dependencies]
4141
```
4242

43-
The `name` field under `package` determines the name of the project. This is
43+
The `name` field under `[package]` determines the name of the project. This is
4444
used by `crates.io` if you publish the crate (more later). It is also the name
4545
of the output binary when you compile.
4646

@@ -49,14 +49,14 @@ Versioning](http://semver.org/).
4949

5050
The `authors` field is a list of authors used when publishing the crate.
5151

52-
The `dependencies` section lets you add a dependency for your project.
52+
The `[dependencies]` section lets you add dependencies for your project.
5353

54-
For example, suppose that I want my program to have a great CLI. You can find
54+
For example, suppose that we want our program to have a great CLI. You can find
5555
lots of great packages on [crates.io](https://crates.io) (the official Rust
5656
package registry). One popular choice is [clap](https://crates.io/crates/clap).
5757
As of this writing, the most recent published version of `clap` is `2.27.1`. To
5858
add a dependency to our program, we can simply add the following to our
59-
`Cargo.toml` under `dependencies`: `clap = "2.27.1"`. And of course, `extern
59+
`Cargo.toml` under `[dependencies]`: `clap = "2.27.1"`. And of course, `extern
6060
crate clap` in `main.rs`, just like normal. And that's it! You can start using
6161
`clap` in your program.
6262

0 commit comments

Comments
 (0)