@@ -15,10 +15,10 @@ cargo new foo
15
15
cargo new --lib foo
16
16
```
17
17
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
19
19
a library, but all of the concepts are the same.
20
20
21
- After the above commands, you should see something like this:
21
+ After the above commands, you should see a file hierarchy like this:
22
22
23
23
``` txt
24
24
foo
@@ -40,7 +40,7 @@ authors = ["mark"]
40
40
[dependencies ]
41
41
```
42
42
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
44
44
used by ` crates.io ` if you publish the crate (more later). It is also the name
45
45
of the output binary when you compile.
46
46
@@ -49,14 +49,14 @@ Versioning](http://semver.org/).
49
49
50
50
The ` authors ` field is a list of authors used when publishing the crate.
51
51
52
- The ` dependencies ` section lets you add a dependency for your project.
52
+ The ` [ dependencies] ` section lets you add dependencies for your project.
53
53
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
55
55
lots of great packages on [ crates.io] ( https://crates.io ) (the official Rust
56
56
package registry). One popular choice is [ clap] ( https://crates.io/crates/clap ) .
57
57
As of this writing, the most recent published version of ` clap ` is ` 2.27.1 ` . To
58
58
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
60
60
crate clap` in ` main.rs`, just like normal. And that's it! You can start using
61
61
` clap ` in your program.
62
62
0 commit comments