Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify English used in guide #14825

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/doc/src/guide/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To depend on a library hosted on [crates.io], add it to your `Cargo.toml`.

If your `Cargo.toml` doesn't already have a `[dependencies]` section, add
that, then list the [crate][def-crate] name and version that you would like to
use. This example adds a dependency of the `time` crate:
use. This example adds a dependency on the `time` crate:

```toml
[dependencies]
Expand Down Expand Up @@ -67,7 +67,7 @@ Our `Cargo.lock` contains the exact information about which revision of all of
these dependencies we used.

Now, if `regex` gets updated, we will still build with the same revision until
we choose to `cargo update`.
we choose to run `cargo update`.

You can now use the `regex` library in `main.rs`.

Expand Down
14 changes: 7 additions & 7 deletions src/doc/src/guide/why-cargo-exists.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
In Rust, as you may know, a library or executable program is called a
[*crate*][def-crate]. Crates are compiled using the Rust compiler,
`rustc`. When starting with Rust, the first source code most people encounter
is that of the venerable “hello world” program, which they compile by invoking
is that of the classic “hello world” program, which they compile by invoking
`rustc` directly:

```console
Expand All @@ -18,15 +18,15 @@ Note that the above command required that we specify the file name
explicitly. If we were to directly use `rustc` to compile a different program,
a different command line invocation would be required. If we needed to specify
any specific compiler flags or include external dependencies, then the
needed command would be even more specific (and elaborate).
needed command would be even more specific (and complex).

Furthermore, most non-trivial programs will likely have dependencies on
external libraries, and will therefore also depend transitively on *their*
dependencies. Obtaining the correct versions of all the necessary dependencies
and keeping them up to date would be laborious and error-prone if done by
and keeping them up to date would be hard and error-prone if done by
hand.

Rather than work only with crates and `rustc`, we can avoid the manual tedium
Rather than work only with crates and `rustc`, we can avoid the difficulties
involved with performing the above tasks by introducing a higher-level
["*package*"][def-package] abstraction and by using a
[*package manager*][def-package-manager].
Expand All @@ -51,9 +51,9 @@ we show later, the same command can be used to build different
[*artifacts*][def-artifact], regardless of their names. Rather than invoke
`rustc` directly, we can instead invoke something generic such as `cargo
build` and let cargo worry about constructing the correct `rustc`
invocation. Furthermore, Cargo will automatically fetch from a
[*registry*][def-registry] any dependencies we have defined for our artifact,
and arrange for them to be incorporated into our build as needed.
invocation. Furthermore, Cargo will automatically fetch any dependencies
we have defined for our artifact from a [*registry*][def-registry],
and arrange for them to be added into our build as needed.

It is only a slight exaggeration to say that once you know how to build one
Cargo-based project, you know how to build *all* of them.
Expand Down