55In Rust, as you may know, a library or executable program is called a
66[ * crate* ] [ def-crate ] . Crates are compiled using the Rust compiler,
77` 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
99` rustc ` directly:
1010
1111``` console
@@ -18,15 +18,15 @@ Note that the above command required that we specify the file name
1818explicitly. If we were to directly use ` rustc ` to compile a different program,
1919a different command line invocation would be required. If we needed to specify
2020any 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 ).
2222
2323Furthermore, most non-trivial programs will likely have dependencies on
2424external libraries, and will therefore also depend transitively on * their*
2525dependencies. 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
2727hand.
2828
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
3030involved with performing the above tasks by introducing a higher-level
3131[ "* package* "] [ def-package ] abstraction and by using a
3232[ * package manager* ] [ def-package-manager ] .
@@ -51,9 +51,9 @@ we show later, the same command can be used to build different
5151[ * artifacts* ] [ def-artifact ] , regardless of their names. Rather than invoke
5252` rustc ` directly, we can instead invoke something generic such as `cargo
5353build` 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.
5757
5858It is only a slight exaggeration to say that once you know how to build one
5959Cargo-based project, you know how to build * all* of them.
0 commit comments