5
5
In Rust, as you may know, a library or executable program is called a
6
6
[ * crate* ] [ def-crate ] . Crates are compiled using the Rust compiler,
7
7
` rustc ` . When starting with Rust, the first source code most people encounter
8
- is that of the venerable “hello world” program, which they compile by invoking
8
+ is that of the classic “hello world” program, which they compile by invoking
9
9
` rustc ` directly:
10
10
11
11
``` console
@@ -18,15 +18,15 @@ Note that the above command required that we specify the file name
18
18
explicitly. If we were to directly use ` rustc ` to compile a different program,
19
19
a different command line invocation would be required. If we needed to specify
20
20
any specific compiler flags or include external dependencies, then the
21
- needed command would be even more specific (and elaborate ).
21
+ needed command would be even more specific (and complex ).
22
22
23
23
Furthermore, most non-trivial programs will likely have dependencies on
24
24
external libraries, and will therefore also depend transitively on * their*
25
25
dependencies. Obtaining the correct versions of all the necessary dependencies
26
- and keeping them up to date would be laborious and error-prone if done by
26
+ and keeping them up to date would be hard and error-prone if done by
27
27
hand.
28
28
29
- Rather than work only with crates and ` rustc ` , we can avoid the manual tedium
29
+ Rather than work only with crates and ` rustc ` , we can avoid the difficulties
30
30
involved with performing the above tasks by introducing a higher-level
31
31
[ "* package* "] [ def-package ] abstraction and by using a
32
32
[ * package manager* ] [ def-package-manager ] .
@@ -51,9 +51,9 @@ we show later, the same command can be used to build different
51
51
[ * artifacts* ] [ def-artifact ] , regardless of their names. Rather than invoke
52
52
` rustc ` directly, we can instead invoke something generic such as `cargo
53
53
build` and let cargo worry about constructing the correct ` rustc`
54
- invocation. Furthermore, Cargo will automatically fetch from a
55
- [ * registry * ] [ def-registry ] any dependencies we have defined for our artifact,
56
- and arrange for them to be incorporated into our build as needed.
54
+ invocation. Furthermore, Cargo will automatically fetch any dependencies
55
+ we have defined for our artifact from a [ * registry * ] [ def-registry ] ,
56
+ and arrange for them to be added into our build as needed.
57
57
58
58
It is only a slight exaggeration to say that once you know how to build one
59
59
Cargo-based project, you know how to build * all* of them.
0 commit comments