diff --git a/src/cargo/ops/tree/format/mod.rs b/src/cargo/ops/tree/format/mod.rs index 5d551409b1c..b746fb98488 100644 --- a/src/cargo/ops/tree/format/mod.rs +++ b/src/cargo/ops/tree/format/mod.rs @@ -108,7 +108,7 @@ impl<'a> fmt::Display for Display<'a> { .iter() .find(|target| target.is_lib()) { - write!(fmt, "{}", target.name())?; + write!(fmt, "{}", target.crate_name())?; } } } diff --git a/src/doc/man/cargo-tree.md b/src/doc/man/cargo-tree.md index 1f5c6d0a209..7a6a8de6b27 100644 --- a/src/doc/man/cargo-tree.md +++ b/src/doc/man/cargo-tree.md @@ -145,7 +145,7 @@ strings will be replaced with the corresponding value: - `{l}` — The package license. - `{r}` — The package repository URL. - `{f}` — Comma-separated list of package features that are enabled. -- `{lib}` — The name of the package's library. +- `{lib}` — The name, as used in a `use` statement, of the package's library. {{/option}} {{#option "`--prefix` _prefix_" }} diff --git a/src/doc/man/generated_txt/cargo-tree.txt b/src/doc/man/generated_txt/cargo-tree.txt index 7d7a3b0574a..2218d540f3f 100644 --- a/src/doc/man/generated_txt/cargo-tree.txt +++ b/src/doc/man/generated_txt/cargo-tree.txt @@ -138,7 +138,8 @@ OPTIONS o {f} — Comma-separated list of package features that are enabled. - o {lib} — The name of the package's library. + o {lib} — The name, as used in a use statement, of the package's + library. --prefix prefix Sets how each line is displayed. The prefix value can be one of: diff --git a/src/doc/src/commands/cargo-tree.md b/src/doc/src/commands/cargo-tree.md index a0d2c136962..bc9a0b15872 100644 --- a/src/doc/src/commands/cargo-tree.md +++ b/src/doc/src/commands/cargo-tree.md @@ -145,7 +145,7 @@ strings will be replaced with the corresponding value:
{l}
— The package license.{r}
— The package repository URL.{f}
— Comma-separated list of package features that are enabled.{lib}
— The name of the package's library.{lib}
— The name, as used in a use
statement, of the package's library.