Skip to content

Commit

Permalink
Remove the --all-features tip
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <[email protected]>
  • Loading branch information
Rustin170506 committed Nov 20, 2022
1 parent a4f89ea commit c5eb618
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/cargo/ops/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@ pub fn build_and_print(ws: &Workspace<'_>, opts: &TreeOptions) -> CargoResult<()
.collect::<CargoResult<Vec<PackageIdSpec>>>()?;

if root_indexes.len() == 0 {
ws.config().shell().warn("nothing to print.\n\n\
To find dependencies that require specific features or target platforms, \
try use options `--all-features` or `--target all` first, and then narrow your search scope accordingly.")?;
ws.config().shell().warn(
"nothing to print.\n\n\
To find dependencies that require specific target platforms, \
try use option `--target all` first, and then narrow your search scope accordingly.",
)?;
} else {
print(ws.config(), opts, root_indexes, &pkgs_to_prune, &graph)?;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ foo v0.1.0 ([..]/foo)
"\
[WARNING] nothing to print.
To find dependencies that require specific features or target platforms, \
try use options `--all-features` or `--target all` first, and then narrow your search scope accordingly.
To find dependencies that require specific target platforms, \
try use option `--target all` first, and then narrow your search scope accordingly.
",
)
.run();
Expand Down

0 comments on commit c5eb618

Please sign in to comment.