Skip to content

Commit 98edd70

Browse files
committed
Suggest cargo add when installing library crate
1 parent ba607b2 commit 98edd70

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/cargo/ops/cargo_install.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> {
209209
bail!(
210210
"there is nothing to install in `{}`, because it has no binaries\n\
211211
`cargo install` is only for installing programs, and can't be used with libraries.\n\
212-
To use a library crate, add it as a dependency in a Cargo project instead.",
213-
pkg
212+
To use a library crate, add it as a dependency to a Cargo project with `cargo add`.",
213+
pkg,
214214
);
215215
}
216216

tests/testsuite/install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ fn no_binaries() {
730730
"\
731731
[ERROR] there is nothing to install in `foo v0.0.1 ([..])`, because it has no binaries[..]
732732
[..]
733-
[..]",
733+
To use a library crate, add it as a dependency to a Cargo project with `cargo add`.",
734734
)
735735
.run();
736736
}

0 commit comments

Comments
 (0)