Skip to content

Commit dc83ead

Browse files
committed
Auto merge of #6687 - dwijnand:cosmetic-2, r=dwijnand
Various cosmetic improvements Resubmit of #6673 which, somehow, broke. cc @alexreg
2 parents b33ce7f + f7c91ba commit dc83ead

File tree

114 files changed

+1104
-1126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1104
-1126
lines changed

ARCHITECTURE.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ find it useful if you want to contribute to Cargo or if you are
55
interested in the inner workings of Cargo.
66

77
The purpose of Cargo is to formalize a canonical Rust workflow, by automating
8-
the standard tasks associated with distributing software. Cargo simplifies
8+
the standard tasks associated with distributing software. Cargo simplifies
99
structuring a new project, adding dependencies, writing and running unit tests,
1010
and more.
1111

@@ -58,7 +58,7 @@ the local hard drive.
5858

5959
`Resolve` is the representation of a directed acyclic graph of package
6060
dependencies, which uses `PackageId`s for nodes. This is the data
61-
structure that is saved to the lock file. If there is no lockfile,
61+
structure that is saved to the lock file. If there is no lock file,
6262
Cargo constructs a resolve by finding a graph of packages which
6363
matches declared dependency specification according to semver.
6464

@@ -118,14 +118,14 @@ to nightly rustc).
118118

119119
Cargo uses [`env_logger`](https://docs.rs/env_logger/*/env_logger/), so you can set
120120
`RUST_LOG` environment variable to get the logs. This is useful both for diagnosing
121-
bugs in stable Cargo and for local development. Cargo also has internal hierarchical
122-
profiling infrastructure, which is activated via `CARGO_PROFILE` variable
121+
bugs in stable Cargo and for local development. Cargo also has internal hierarchical
122+
profiling infrastructure, which is activated via `CARGO_PROFILE` variable
123123

124124
```
125-
# Outputs all logs with levels debug and higher
125+
# Outputs all logs with levels debug and higher
126126
$ RUST_LOG=debug cargo generate-lockfile
127127
128-
# Don't forget that you can filter by module as well
128+
# Don't forget that you can filter by module as well
129129
$ RUST_LOG=cargo::core::resolver=trace cargo generate-lockfile
130130
131131
# Output first three levels of profiling info

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ working on.
8686
* Include tests that cover all non-trivial code. The existing tests
8787
in `test/` provide templates on how to test Cargo's behavior in a
8888
sandbox-environment. The internal module `testsuite/support` provides a vast amount
89-
of helpers to minimize boilerplate. See [`testsuite/support/mod.rs`] for an
89+
of helpers to minimize boilerplate. See [`testsuite/support/mod.rs`] for an
9090
introduction to writing tests.
9191
* Make sure `cargo test` passes. If you do not have the cross-compilers
9292
installed locally, install them using the instructions returned by
@@ -110,7 +110,7 @@ weekends. If you don't get a reply, you may poke the core developers on [Discord
110110

111111
A merge of Cargo's master-branch and your changes is immediately queued
112112
to be tested after the pull request is made. In case unforeseen
113-
problems are discovered during this step (e.g. a failure on a platform you
113+
problems are discovered during this step (e.g., a failure on a platform you
114114
originally did not develop on), you may ask for guidance. Push additional
115115
commits to your branch to tackle these problems.
116116

src/bin/cargo/commands/bench.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ pub fn cli() -> App {
4646
))
4747
.after_help(
4848
"\
49-
The benchmark filtering argument `BENCHNAME` and all the arguments following the
49+
The benchmark filtering argument BENCHNAME and all the arguments following the
5050
two dashes (`--`) are passed to the benchmark binaries and thus to libtest
51-
(rustc's built in unit-test and micro-benchmarking framework). If you're
51+
(rustc's built in unit-test and micro-benchmarking framework). If you're
5252
passing arguments to both Cargo and the binary, the ones after `--` go to the
53-
binary, the ones before go to Cargo. For details about libtest's arguments see
53+
binary, the ones before go to Cargo. For details about libtest's arguments see
5454
the output of `cargo bench -- --help`.
5555
56-
If the --package argument is given, then SPEC is a package id specification
56+
If the `--package` argument is given, then SPEC is a package ID specification
5757
which indicates which package should be benchmarked. If it is not given, then
5858
the current package is benchmarked. For more information on SPEC and its format,
5959
see the `cargo help pkgid` command.
@@ -62,7 +62,7 @@ All packages in the workspace are benchmarked if the `--all` flag is supplied. T
6262
`--all` flag is automatically assumed for a virtual manifest.
6363
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
6464
65-
The --jobs argument affects the building of the benchmark executable but does
65+
The `--jobs` argument affects the building of the benchmark executable but does
6666
not affect how many jobs are used when running the benchmarks.
6767
6868
Compilation can be customized with the `bench` profile in the manifest.

src/bin/cargo/commands/check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn cli() -> App {
3434
.arg_message_format()
3535
.after_help(
3636
"\
37-
If the --package argument is given, then SPEC is a package id specification
37+
If the `--package` argument is given, then SPEC is a package ID specification
3838
which indicates which package should be built. If it is not given, then the
3939
current package is built. For more information on SPEC and its format, see the
4040
`cargo help pkgid` command.
@@ -45,7 +45,7 @@ Note that `--exclude` has to be specified in conjunction with the `--all` flag.
4545
4646
Compilation can be configured via the use of profiles which are configured in
4747
the manifest. The default profile for this command is `dev`, but passing
48-
the --release flag will use the `release` profile instead.
48+
the `--release` flag will use the `release` profile instead.
4949
5050
The `--profile test` flag can be used to check unit tests with the
5151
`#[cfg(test)]` attribute.

src/bin/cargo/commands/clean.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn cli() -> App {
1313
.arg_doc("Whether or not to clean just the documentation directory")
1414
.after_help(
1515
"\
16-
If the --package argument is given, then SPEC is a package id specification
16+
If the `--package` argument is given, then SPEC is a package ID specification
1717
which indicates which package's artifacts should be cleaned out. If it is not
1818
given, then all packages' artifacts are removed. For more information on SPEC
1919
and its format, see the `cargo help pkgid` command.

src/bin/cargo/commands/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ All packages in the workspace are documented if the `--all` flag is supplied. Th
3737
`--all` flag is automatically assumed for a virtual manifest.
3838
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
3939
40-
If the --package argument is given, then SPEC is a package id specification
40+
If the `--package` argument is given, then SPEC is a package ID specification
4141
which indicates which package should be documented. If it is not given, then the
4242
current package is documented. For more information on SPEC and its format, see
4343
the `cargo help pkgid` command.

src/bin/cargo/commands/fetch.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ pub fn cli() -> App {
1010
.arg_target_triple("Fetch dependencies for the target triple")
1111
.after_help(
1212
"\
13-
If a lockfile is available, this command will ensure that all of the git
13+
If a lock file is available, this command will ensure that all of the Git
1414
dependencies and/or registries dependencies are downloaded and locally
1515
available. The network is never touched after a `cargo fetch` unless
16-
the lockfile changes.
16+
the lock file changes.
1717
18-
If the lockfile is not available, then this is the equivalent of
19-
`cargo generate-lockfile`. A lockfile is generated and dependencies are also
18+
If the lock file is not available, then this is the equivalent of
19+
`cargo generate-lockfile`. A lock file is generated and dependencies are also
2020
all updated.
2121
",
2222
)

src/bin/cargo/commands/install.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ enables overwriting existing binaries. Thus you can reinstall a crate with
6363
6464
Omitting the <crate> specification entirely will
6565
install the crate in the current directory. That is, `install` is equivalent to
66-
the more explicit `install --path .`. This behaviour is deprecated, and no
66+
the more explicit `install --path .`. This behaviour is deprecated, and no
6767
longer supported as of the Rust 2018 edition.
6868
6969
If the source is crates.io or `--git` then by default the crate will be built
70-
in a temporary target directory. To avoid this, the target directory can be
70+
in a temporary target directory. To avoid this, the target directory can be
7171
specified by setting the `CARGO_TARGET_DIR` environment variable to a relative
72-
path. In particular, this can be useful for caching build artifacts on
72+
path. In particular, this can be useful for caching build artifacts on
7373
continuous integration systems.",
7474
)
7575
}

src/bin/cargo/commands/pkgid.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ pub fn cli() -> App {
66
subcommand("pkgid")
77
.about("Print a fully qualified package specification")
88
.arg(Arg::with_name("spec"))
9-
.arg_package("Argument to get the package id specifier for")
9+
.arg_package("Argument to get the package ID specifier for")
1010
.arg_manifest_path()
1111
.after_help(
1212
"\
13-
Given a <spec> argument, print out the fully qualified package id specifier.
13+
Given a <spec> argument, print out the fully qualified package ID specifier.
1414
This command will generate an error if <spec> is ambiguous as to which package
1515
it refers to in the dependency graph. If no <spec> is given, then the pkgid for
1616
the local package is printed.

src/bin/cargo/commands/rustdoc.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use crate::command_prelude::*;
2-
31
use cargo::ops::{self, DocOptions};
42

3+
use crate::command_prelude::*;
4+
55
pub fn cli() -> App {
66
subcommand("rustdoc")
77
.setting(AppSettings::TrailingVarArg)
@@ -34,13 +34,13 @@ pub fn cli() -> App {
3434
.after_help(
3535
"\
3636
The specified target for the current package (or package specified by SPEC if
37-
provided) will be documented with the specified <opts>... being passed to the
37+
provided) will be documented with the specified `<opts>...` being passed to the
3838
final rustdoc invocation. Dependencies will not be documented as part of this
39-
command. Note that rustdoc will still unconditionally receive arguments such
40-
as -L, --extern, and --crate-type, and the specified <opts>... will simply be
41-
added to the rustdoc invocation.
39+
command. Note that rustdoc will still unconditionally receive arguments such
40+
as `-L`, `--extern`, and `--crate-type`, and the specified `<opts>...` will
41+
simply be added to the rustdoc invocation.
4242
43-
If the --package argument is given, then SPEC is a package id specification
43+
If the `--package` argument is given, then SPEC is a package ID specification
4444
which indicates which package should be documented. If it is not given, then the
4545
current package is documented. For more information on SPEC and its format, see
4646
the `cargo help pkgid` command.

src/bin/cargo/commands/test.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use crate::command_prelude::*;
2-
31
use cargo::ops::{self, CompileFilter};
42

3+
use crate::command_prelude::*;
4+
55
pub fn cli() -> App {
66
subcommand("test")
7-
// subcommand aliases are handled in aliased_command()
7+
// Subcommand aliases are handled in `aliased_command()`.
88
// .alias("t")
99
.setting(AppSettings::TrailingVarArg)
1010
.about("Execute all unit and integration tests and build examples of a local package")
@@ -47,17 +47,17 @@ pub fn cli() -> App {
4747
.arg_message_format()
4848
.after_help(
4949
"\
50-
The test filtering argument `TESTNAME` and all the arguments following the
50+
The test filtering argument TESTNAME and all the arguments following the
5151
two dashes (`--`) are passed to the test binaries and thus to libtest
52-
(rustc's built in unit-test and micro-benchmarking framework). If you're
52+
(rustc's built in unit-test and micro-benchmarking framework). If you're
5353
passing arguments to both Cargo and the binary, the ones after `--` go to the
54-
binary, the ones before go to Cargo. For details about libtest's arguments see
55-
the output of `cargo test -- --help`. As an example, this will run all
54+
binary, the ones before go to Cargo. For details about libtest's arguments see
55+
the output of `cargo test -- --help`. As an example, this will run all
5656
tests with `foo` in their name on 3 threads in parallel:
5757
5858
cargo test foo -- --test-threads 3
5959
60-
If the --package argument is given, then SPEC is a package id specification
60+
If the `--package` argument is given, then SPEC is a package ID specification
6161
which indicates which package should be tested. If it is not given, then the
6262
current package is tested. For more information on SPEC and its format, see the
6363
`cargo help pkgid` command.
@@ -66,9 +66,9 @@ All packages in the workspace are tested if the `--all` flag is supplied. The
6666
`--all` flag is automatically assumed for a virtual manifest.
6767
Note that `--exclude` has to be specified in conjunction with the `--all` flag.
6868
69-
The --jobs argument affects the building of the test executable but does
69+
The `--jobs` argument affects the building of the test executable but does
7070
not affect how many jobs are used when running the tests. The default value
71-
for the --jobs argument is the number of CPUs. If you want to control the
71+
for the `--jobs` argument is the number of CPUs. If you want to control the
7272
number of simultaneous running test cases, pass the `--test-threads` option
7373
to the test binaries:
7474
@@ -77,7 +77,7 @@ to the test binaries:
7777
Compilation can be configured via the `test` profile in the manifest.
7878
7979
By default the rust test harness hides output from test execution to
80-
keep results readable. Test output can be recovered (e.g. for debugging)
80+
keep results readable. Test output can be recovered (e.g., for debugging)
8181
by passing `--nocapture` to the test binaries:
8282
8383
cargo test -- --nocapture
@@ -130,8 +130,8 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
130130
compile_opts,
131131
};
132132

133-
// TESTNAME is actually an argument of the test binary, but it's
134-
// important so we explicitly mention it and reconfigure
133+
// `TESTNAME` is actually an argument of the test binary, but it's
134+
// important, so we explicitly mention it and reconfigure.
135135
let mut test_args = vec![];
136136
test_args.extend(args.value_of("TESTNAME").into_iter().map(|s| s.to_string()));
137137
test_args.extend(

src/bin/cargo/commands/uninstall.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn cli() -> App {
1111
.arg(opt("root", "Directory to uninstall packages from").value_name("DIR"))
1212
.after_help(
1313
"\
14-
The argument SPEC is a package id specification (see `cargo help pkgid`) to
14+
The argument SPEC is a package ID specification (see `cargo help pkgid`) to
1515
specify which crate should be uninstalled. By default all binaries are
1616
uninstalled for a crate but the `--bin` and `--example` flags can be used to
1717
only uninstall particular binaries.

src/bin/cargo/commands/update.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ This command requires that a `Cargo.lock` already exists as generated by
2121
If SPEC is given, then a conservative update of the lockfile will be
2222
performed. This means that only the dependency specified by SPEC will be
2323
updated. Its transitive dependencies will be updated only if SPEC cannot be
24-
updated without updating dependencies. All other dependencies will remain
24+
updated without updating dependencies. All other dependencies will remain
2525
locked at their currently recorded versions.
2626
27-
If PRECISE is specified, then --aggressive must not also be specified. The
27+
If PRECISE is specified, then `--aggressive` must not also be specified. The
2828
argument PRECISE is a string representing a precise revision that the package
2929
being updated should be updated to. For example, if the package comes from a git
3030
repository, then PRECISE would be the exact revision that the repository should
@@ -33,7 +33,7 @@ be updated to.
3333
If SPEC is not given, then all dependencies will be re-resolved and
3434
updated.
3535
36-
For more information about package id specifications, see `cargo help pkgid`.
36+
For more information about package ID specifications, see `cargo help pkgid`.
3737
",
3838
)
3939
}

0 commit comments

Comments
 (0)