@@ -16,8 +16,8 @@ We recommend pairing this with
1616
1717Let’s dig in a little bit more.
1818
19- ` Cargo.toml ` is a [ ** manifest** ] [ def-manifest ] file in which we can specify a
20- bunch of different metadata about our package. For example, we can say that we
19+ ` Cargo.toml ` is a [ ** manifest** ] [ def-manifest ] file in which you can specify a
20+ bunch of different metadata about our package. For example, you can say that you
2121depend on another package:
2222
2323``` toml
@@ -29,31 +29,31 @@ version = "0.1.0"
2929regex = { git = " https://github.com/rust-lang/regex.git" }
3030```
3131
32- This package has a single dependency, on the ` regex ` library. We’ve stated in
33- this case that we’re relying on a particular Git repository that lives on
34- GitHub. Since we haven’t specified any other information, Cargo assumes that
35- we intend to use the latest commit on the default branch to build our package.
32+ This package has a single dependency, on the ` regex ` library. It states in
33+ this case to rely on a particular Git repository that lives on
34+ GitHub. Since you haven’t specified any other information, Cargo assumes that
35+ you intend to use the latest commit on the default branch to build our package.
3636
3737Sound good? Well, there’s one problem: If you build this package today, and
3838then you send a copy to me, and I build this package tomorrow, something bad
3939could happen. There could be more commits to ` regex ` in the meantime, and my
4040build would include new commits while yours would not. Therefore, we would
4141get different builds. This would be bad because we want reproducible builds.
4242
43- We could fix this problem by defining a specific ` rev ` value in our ` Cargo.toml ` ,
43+ You could fix this problem by defining a specific ` rev ` value in our ` Cargo.toml ` ,
4444so Cargo could know exactly which revision to use when building the package:
4545
4646``` toml
4747[dependencies ]
4848regex = { git = " https://github.com/rust-lang/regex.git" , rev = " 9f9f693" }
4949```
5050
51- Now our builds will be the same. But there’s a big drawback: now we have to
52- manually think about SHA-1s every time we want to update our library. This is
51+ Now our builds will be the same. But there’s a big drawback: now you have to
52+ manually think about SHA-1s every time you want to update our library. This is
5353both tedious and error prone.
5454
55- Enter the ` Cargo.lock ` . Because of its existence, we don’t need to manually
56- keep track of the exact revisions: Cargo will do it for us . When we have a
55+ Enter the ` Cargo.lock ` . Because of its existence, you don’t need to manually
56+ keep track of the exact revisions: Cargo will do it for you . When you have a
5757manifest like this:
5858
5959``` toml
@@ -65,8 +65,8 @@ version = "0.1.0"
6565regex = { git = " https://github.com/rust-lang/regex.git" }
6666```
6767
68- Cargo will take the latest commit and write that information out into our
69- ` Cargo.lock ` when we build for the first time. That file will look like this:
68+ Cargo will take the latest commit and write that information out into your
69+ ` Cargo.lock ` when you build for the first time. That file will look like this:
7070
7171``` toml
7272[[package ]]
@@ -83,12 +83,12 @@ source = "git+https://github.com/rust-lang/regex.git#9f9f693768c584971a4d53bc3c5
8383```
8484
8585You can see that there’s a lot more information here, including the exact
86- revision we used to build. Now when you give your package to someone else,
87- they’ll use the exact same SHA, even though we didn’t specify it in our
86+ revision you used to build. Now when you give your package to someone else,
87+ they’ll use the exact same SHA, even though you didn’t specify it in your
8888` Cargo.toml ` .
8989
90- When we’ re ready to opt in to a new version of the library, Cargo can
91- re-calculate the dependencies and update things for us :
90+ When you' re ready to opt in to a new version of the library, Cargo can
91+ re-calculate the dependencies and update things for you :
9292
9393``` console
9494$ cargo update # updates all dependencies
0 commit comments