@@ -16,8 +16,8 @@ We recommend pairing this with
16
16
17
17
Let’s dig in a little bit more.
18
18
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
21
21
depend on another package:
22
22
23
23
``` toml
@@ -29,31 +29,31 @@ version = "0.1.0"
29
29
regex = { git = " https://github.com/rust-lang/regex.git" }
30
30
```
31
31
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.
36
36
37
37
Sound good? Well, there’s one problem: If you build this package today, and
38
38
then you send a copy to me, and I build this package tomorrow, something bad
39
39
could happen. There could be more commits to ` regex ` in the meantime, and my
40
40
build would include new commits while yours would not. Therefore, we would
41
41
get different builds. This would be bad because we want reproducible builds.
42
42
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 ` ,
44
44
so Cargo could know exactly which revision to use when building the package:
45
45
46
46
``` toml
47
47
[dependencies ]
48
48
regex = { git = " https://github.com/rust-lang/regex.git" , rev = " 9f9f693" }
49
49
```
50
50
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
53
53
both tedious and error prone.
54
54
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
57
57
manifest like this:
58
58
59
59
``` toml
@@ -65,8 +65,8 @@ version = "0.1.0"
65
65
regex = { git = " https://github.com/rust-lang/regex.git" }
66
66
```
67
67
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:
70
70
71
71
``` toml
72
72
[[package ]]
@@ -83,12 +83,12 @@ source = "git+https://github.com/rust-lang/regex.git#9f9f693768c584971a4d53bc3c5
83
83
```
84
84
85
85
You 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
88
88
` Cargo.toml ` .
89
89
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 :
92
92
93
93
``` console
94
94
$ cargo update # updates all dependencies
0 commit comments