Skip to content

Commit f9047dc

Browse files
committed
Auto merge of #8121 - huangjiahua:update-documentation, r=alexcrichton
Update documentation to mention "config.toml" instead of "config" I searched for the reference of `config` and `credentials` in `src/doc` and changed to `config.toml` and `credentials.toml` accroding to the context. #7323
2 parents ebda506 + 25409e5 commit f9047dc

18 files changed

+53
-53
lines changed

src/doc/man/cargo-login.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cargo-login - Save an API token from the registry locally
1414

1515
This command will save the API token to disk so that commands that require
1616
authentication, such as man:cargo-publish[1], will be automatically
17-
authenticated. The token is saved in `$CARGO_HOME/credentials`. `CARGO_HOME`
17+
authenticated. The token is saved in `$CARGO_HOME/credentials.toml`. `CARGO_HOME`
1818
defaults to `.cargo` in your home directory.
1919

2020
If the _TOKEN_ argument is not specified, it will be read from stdin.

src/doc/man/cargo-vendor.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies specified. Additional manifests beyond the default one can be
1919
specified with the `-s` option.
2020

2121
The `cargo vendor` command will also print out the configuration necessary
22-
to use the vendored sources, which you will need to add to `.cargo/config`.
22+
to use the vendored sources, which you will need to add to `.cargo/config.toml`.
2323

2424
== OPTIONS
2525

@@ -35,7 +35,7 @@ to use the vendored sources, which you will need to add to `.cargo/config`.
3535
existing contents of the vendor directory
3636

3737
*--respect-source-config*::
38-
Instead of ignoring `[source]` configuration by default in `.cargo/config`
38+
Instead of ignoring `[source]` configuration by default in `.cargo/config.toml`
3939
read it and use it when downloading crates from crates.io, for example
4040

4141
*--versioned-dirs*::

src/doc/man/cargo.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,16 @@ include::section-exit-status.adoc[]
169169
Binaries installed by man:cargo-install[1] will be located here. If using
170170
rustup, executables distributed with Rust are also located here.
171171

172-
`$CARGO_HOME/config`::
172+
`$CARGO_HOME/config.toml`::
173173
The global configuration file. See linkcargo:reference/config.html[the reference]
174174
for more information about configuration files.
175175

176-
`.cargo/config`::
177-
Cargo automatically searches for a file named `.cargo/config` in the
176+
`.cargo/config.toml`::
177+
Cargo automatically searches for a file named `.cargo/config.toml` in the
178178
current directory, and all parent directories. These configuration files
179179
will be merged with the global configuration file.
180180

181-
`$CARGO_HOME/credentials`::
181+
`$CARGO_HOME/credentials.toml`::
182182
Private authentication information for logging in to a registry.
183183

184184
`$CARGO_HOME/registry/`::

src/doc/man/generated/cargo-login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2 id="cargo_login_description">DESCRIPTION</h2>
1616
<div class="paragraph">
1717
<p>This command will save the API token to disk so that commands that require
1818
authentication, such as <a href="cargo-publish.html">cargo-publish(1)</a>, will be automatically
19-
authenticated. The token is saved in <code>$CARGO_HOME/credentials</code>. <code>CARGO_HOME</code>
19+
authenticated. The token is saved in <code>$CARGO_HOME/credentials.toml</code>. <code>CARGO_HOME</code>
2020
defaults to <code>.cargo</code> in your home directory.</p>
2121
</div>
2222
<div class="paragraph">

src/doc/man/generated/cargo-vendor.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2 id="cargo_vendor_description">DESCRIPTION</h2>
2222
</div>
2323
<div class="paragraph">
2424
<p>The <code>cargo vendor</code> command will also print out the configuration necessary
25-
to use the vendored sources, which you will need to add to <code>.cargo/config</code>.</p>
25+
to use the vendored sources, which you will need to add to <code>.cargo/config.toml</code>.</p>
2626
</div>
2727
</div>
2828
</div>
@@ -46,7 +46,7 @@ <h3 id="cargo_vendor_vendor_options">Vendor Options</h3>
4646
</dd>
4747
<dt class="hdlist1"><strong>--respect-source-config</strong></dt>
4848
<dd>
49-
<p>Instead of ignoring <code>[source]</code> configuration by default in <code>.cargo/config</code>
49+
<p>Instead of ignoring <code>[source]</code> configuration by default in <code>.cargo/config.toml</code>
5050
read it and use it when downloading crates from crates.io, for example</p>
5151
</dd>
5252
<dt class="hdlist1"><strong>--versioned-dirs</strong></dt>

src/doc/man/generated/cargo.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,18 @@ <h2 id="_files">FILES</h2>
354354
<p>Binaries installed by <a href="cargo-install.html">cargo-install(1)</a> will be located here. If using
355355
rustup, executables distributed with Rust are also located here.</p>
356356
</dd>
357-
<dt class="hdlist1"><code>$CARGO_HOME/config</code></dt>
357+
<dt class="hdlist1"><code>$CARGO_HOME/config.toml</code></dt>
358358
<dd>
359359
<p>The global configuration file. See <a href="../reference/config.html">the reference</a>
360360
for more information about configuration files.</p>
361361
</dd>
362-
<dt class="hdlist1"><code>.cargo/config</code></dt>
362+
<dt class="hdlist1"><code>.cargo/config.toml</code></dt>
363363
<dd>
364-
<p>Cargo automatically searches for a file named <code>.cargo/config</code> in the
364+
<p>Cargo automatically searches for a file named <code>.cargo/config.toml</code> in the
365365
current directory, and all parent directories. These configuration files
366366
will be merged with the global configuration file.</p>
367367
</dd>
368-
<dt class="hdlist1"><code>$CARGO_HOME/credentials</code></dt>
368+
<dt class="hdlist1"><code>$CARGO_HOME/credentials.toml</code></dt>
369369
<dd>
370370
<p>Private authentication information for logging in to a registry.</p>
371371
</dd>

src/doc/src/guide/cargo-home.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ The Cargo home consists of following components:
1212

1313
## Files:
1414

15-
* `config`
15+
* `config.toml`
1616
Cargo's global configuration file, see the [config entry in the reference][config].
1717

18-
* `credentials`
18+
* `credentials.toml`
1919
Private login credentials from [`cargo login`] in order to log in to a registry.
2020

2121
* `.crates.toml`

src/doc/src/reference/config.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ all parent directories. If, for example, Cargo were invoked in
1212
`/projects/foo/bar/baz`, then the following configuration files would be
1313
probed for and unified in this order:
1414

15-
* `/projects/foo/bar/baz/.cargo/config`
16-
* `/projects/foo/bar/.cargo/config`
17-
* `/projects/foo/.cargo/config`
18-
* `/projects/.cargo/config`
19-
* `/.cargo/config`
20-
* `$CARGO_HOME/config` which defaults to:
21-
* Windows: `%USERPROFILE%\.cargo\config`
22-
* Unix: `$HOME/.cargo/config`
15+
* `/projects/foo/bar/baz/.cargo/config.toml`
16+
* `/projects/foo/bar/.cargo/config.toml`
17+
* `/projects/foo/.cargo/config.toml`
18+
* `/projects/.cargo/config.toml`
19+
* `/.cargo/config.toml`
20+
* `$CARGO_HOME/config.toml` which defaults to:
21+
* Windows: `%USERPROFILE%\.cargo\config.toml`
22+
* Unix: `$HOME/.cargo/config.toml`
2323

2424
With this structure, you can specify configuration per-package, and even
2525
possibly check it into version control. You can also specify personal defaults
@@ -179,15 +179,15 @@ relative to the current working directory.
179179
runner = "foo" # Searches `PATH` for `foo`.
180180

181181
[source.vendored-sources]
182-
# Directory is relative to the parent where `.cargo/config` is located.
183-
# For example, `/my/project/.cargo/config` would result in `/my/project/vendor`.
182+
# Directory is relative to the parent where `.cargo/config.toml` is located.
183+
# For example, `/my/project/.cargo/config.toml` would result in `/my/project/vendor`.
184184
directory = "vendor"
185185
```
186186

187187
### Credentials
188188

189189
Configuration values with sensitive information are stored in the
190-
`$CARGO_HOME/credentials` file. This file is automatically created and updated
190+
`$CARGO_HOME/credentials.toml` file. This file is automatically created and updated
191191
by [`cargo login`]. It follows the same format as Cargo config files.
192192

193193
```toml

src/doc/src/reference/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ let out_dir = env::var("OUT_DIR").unwrap();
294294
use it as well.
295295
* `RUSTC_LINKER` — The path to the linker binary that Cargo has resolved to use
296296
for the current target, if specified. The linker can be
297-
changed by editing `.cargo/config`; see the documentation
297+
changed by editing `.cargo/config.toml`; see the documentation
298298
about [cargo configuration][cargo-config] for more
299299
information.
300300

src/doc/src/reference/overriding-dependencies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ to modify `Cargo.toml` like with the `[patch]` section above. For this use
318318
case Cargo offers a much more limited version of overrides called **path
319319
overrides**.
320320

321-
Path overrides are specified through [`.cargo/config`](config.md) instead of
322-
`Cargo.toml`. Inside of `.cargo/config` you'll specify a key called `paths`:
321+
Path overrides are specified through [`.cargo/config.toml`](config.md) instead of
322+
`Cargo.toml`. Inside of `.cargo/config.toml` you'll specify a key called `paths`:
323323

324324
```toml
325325
paths = ["/path/to/uuid"]

src/doc/src/reference/publishing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ cargo login abcdefghijklmnopqrstuvwxyz012345
2121
```
2222

2323
This command will inform Cargo of your API token and store it locally in your
24-
`~/.cargo/credentials`. Note that this token is a **secret** and should not be
24+
`~/.cargo/credentials.toml`. Note that this token is a **secret** and should not be
2525
shared with anyone else. If it leaks for any reason, you should regenerate it
2626
immediately.
2727

src/doc/src/reference/registries.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ support publishing new crates directly from Cargo.
1111
### Using an Alternate Registry
1212

1313
To use a registry other than [crates.io], the name and index URL of the
14-
registry must be added to a [`.cargo/config` file][config]. The `registries`
14+
registry must be added to a [`.cargo/config.toml` file][config]. The `registries`
1515
table has a key for each registry, for example:
1616

1717
```toml
@@ -63,7 +63,7 @@ registry to use. For example, to publish the package in the current directory:
6363
2. `cargo publish --registry=my-registry`
6464

6565
Instead of always passing the `--registry` command-line option, the default
66-
registry may be set in [`.cargo/config`][config] with the `registry.default`
66+
registry may be set in [`.cargo/config.toml`][config] with the `registry.default`
6767
key.
6868

6969
Setting the `package.publish` key in the `Cargo.toml` manifest restricts which
@@ -81,7 +81,7 @@ The `publish` value may also be `false` to restrict all publishing, which is
8181
the same as an empty list.
8282

8383
The authentication information saved by [`cargo login`] is stored in the
84-
`credentials` file in the Cargo home directory (default `$HOME/.cargo`). It
84+
`credentials.toml` file in the Cargo home directory (default `$HOME/.cargo`). It
8585
has a separate table for each registry, for example:
8686

8787
```toml

src/doc/src/reference/source-replacement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ chapter][registries].
3131

3232
### Configuration
3333

34-
Configuration of replacement sources is done through [`.cargo/config`][config]
34+
Configuration of replacement sources is done through [`.cargo/config.toml`][config]
3535
and the full set of available keys are:
3636

3737
```toml
@@ -42,7 +42,7 @@ and the full set of available keys are:
4242
# Under the `source` table are a number of other tables whose keys are a
4343
# name for the relevant source. For example this section defines a new
4444
# source, called `my-vendor-source`, which comes from a directory
45-
# located at `vendor` relative to the directory containing this `.cargo/config`
45+
# located at `vendor` relative to the directory containing this `.cargo/config.toml`
4646
# file
4747
[source.my-vendor-source]
4848
directory = "vendor"

src/doc/src/reference/specifying-dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ separated with a comma, e.g., `>= 1.2, < 1.5`.
107107
### Specifying dependencies from other registries
108108

109109
To specify a dependency from a registry other than [crates.io], first the
110-
registry must be configured in a `.cargo/config` file. See the [registries
110+
registry must be configured in a `.cargo/config.toml` file. See the [registries
111111
documentation] for more information. In the dependency, set the `registry` key
112112
to the name of the registry to use.
113113

src/doc/src/reference/unstable.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ index each time.
2626
The `-Z mtime-on-use` flag is an experiment to have Cargo update the mtime of
2727
used files to make it easier for tools like cargo-sweep to detect which files
2828
are stale. For many workflows this needs to be set on *all* invocations of cargo.
29-
To make this more practical setting the `unstable.mtime_on_use` flag in `.cargo/config`
29+
To make this more practical setting the `unstable.mtime_on_use` flag in `.cargo/config.toml`
3030
or the corresponding ENV variable will apply the `-Z mtime-on-use` to all
3131
invocations of nightly cargo. (the config flag is ignored by stable)
3232

@@ -76,7 +76,7 @@ directory. Example:
7676
cargo +nightly build --out-dir=out -Z unstable-options
7777
```
7878

79-
This can also be specified in `.cargo/config` files.
79+
This can also be specified in `.cargo/config.toml` files.
8080

8181
```toml
8282
[build]
@@ -93,7 +93,7 @@ from the host cargo will simply skip testing doctests. If this flag is
9393
present, cargo will continue as normal, passing the tests to doctest,
9494
while also passing it a `--target` option, as well as enabling
9595
`-Zunstable-features --enable-per-target-ignores` and passing along
96-
information from `.cargo/config`. See the rustc issue for more information.
96+
information from `.cargo/config.toml`. See the rustc issue for more information.
9797

9898
```
9999
cargo test --target foo -Zdoctest-xcompile

src/etc/man/cargo-login.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: cargo-login
33
.\" Author: [see the "AUTHOR(S)" section]
44
.\" Generator: Asciidoctor 2.0.10
5-
.\" Date: 2019-06-03
5+
.\" Date: 2020-04-16
66
.\" Manual: \ \&
77
.\" Source: \ \&
88
.\" Language: English
99
.\"
10-
.TH "CARGO\-LOGIN" "1" "2019-06-03" "\ \&" "\ \&"
10+
.TH "CARGO\-LOGIN" "1" "2020-04-16" "\ \&" "\ \&"
1111
.ie \n(.g .ds Aq \(aq
1212
.el .ds Aq '
1313
.ss \n[.ss] 0
@@ -36,7 +36,7 @@ cargo\-login \- Save an API token from the registry locally
3636
.sp
3737
This command will save the API token to disk so that commands that require
3838
authentication, such as \fBcargo\-publish\fP(1), will be automatically
39-
authenticated. The token is saved in \fB$CARGO_HOME/credentials\fP. \fBCARGO_HOME\fP
39+
authenticated. The token is saved in \fB$CARGO_HOME/credentials.toml\fP. \fBCARGO_HOME\fP
4040
defaults to \fB.cargo\fP in your home directory.
4141
.sp
4242
If the \fITOKEN\fP argument is not specified, it will be read from stdin.

src/etc/man/cargo-vendor.1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: cargo-vendor
33
.\" Author: [see the "AUTHOR(S)" section]
44
.\" Generator: Asciidoctor 2.0.10
5-
.\" Date: 2020-03-30
5+
.\" Date: 2020-04-16
66
.\" Manual: \ \&
77
.\" Source: \ \&
88
.\" Language: English
99
.\"
10-
.TH "CARGO\-VENDOR" "1" "2020-03-30" "\ \&" "\ \&"
10+
.TH "CARGO\-VENDOR" "1" "2020-04-16" "\ \&" "\ \&"
1111
.ie \n(.g .ds Aq \(aq
1212
.el .ds Aq '
1313
.ss \n[.ss] 0
@@ -41,7 +41,7 @@ dependencies specified. Additional manifests beyond the default one can be
4141
specified with the \fB\-s\fP option.
4242
.sp
4343
The \fBcargo vendor\fP command will also print out the configuration necessary
44-
to use the vendored sources, which you will need to add to \fB.cargo/config\fP.
44+
to use the vendored sources, which you will need to add to \fB.cargo/config.toml\fP.
4545
.SH "OPTIONS"
4646
.SS "Vendor Options"
4747
.sp
@@ -59,7 +59,7 @@ existing contents of the vendor directory
5959
.sp
6060
\fB\-\-respect\-source\-config\fP
6161
.RS 4
62-
Instead of ignoring \fB[source]\fP configuration by default in \fB.cargo/config\fP
62+
Instead of ignoring \fB[source]\fP configuration by default in \fB.cargo/config.toml\fP
6363
read it and use it when downloading crates from crates.io, for example
6464
.RE
6565
.sp

src/etc/man/cargo.1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: cargo
33
.\" Author: [see the "AUTHOR(S)" section]
44
.\" Generator: Asciidoctor 2.0.10
5-
.\" Date: 2020-03-30
5+
.\" Date: 2020-04-16
66
.\" Manual: \ \&
77
.\" Source: \ \&
88
.\" Language: English
99
.\"
10-
.TH "CARGO" "1" "2020-03-30" "\ \&" "\ \&"
10+
.TH "CARGO" "1" "2020-04-16" "\ \&" "\ \&"
1111
.ie \n(.g .ds Aq \(aq
1212
.el .ds Aq '
1313
.ss \n[.ss] 0
@@ -357,21 +357,21 @@ Binaries installed by \fBcargo\-install\fP(1) will be located here. If using
357357
rustup, executables distributed with Rust are also located here.
358358
.RE
359359
.sp
360-
\fB$CARGO_HOME/config\fP
360+
\fB$CARGO_HOME/config.toml\fP
361361
.RS 4
362362
The global configuration file. See \c
363363
.URL "https://doc.rust\-lang.org/cargo/reference/config.html" "the reference"
364364
for more information about configuration files.
365365
.RE
366366
.sp
367-
\fB.cargo/config\fP
367+
\fB.cargo/config.toml\fP
368368
.RS 4
369-
Cargo automatically searches for a file named \fB.cargo/config\fP in the
369+
Cargo automatically searches for a file named \fB.cargo/config.toml\fP in the
370370
current directory, and all parent directories. These configuration files
371371
will be merged with the global configuration file.
372372
.RE
373373
.sp
374-
\fB$CARGO_HOME/credentials\fP
374+
\fB$CARGO_HOME/credentials.toml\fP
375375
.RS 4
376376
Private authentication information for logging in to a registry.
377377
.RE

0 commit comments

Comments
 (0)