Skip to content

Commit

Permalink
fix(pkgid): More consistently refer to SemVer
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 29, 2023
1 parent 7f168de commit 9750f51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/cargo/util/to_semver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ impl<'a> ToSemver for &'a str {
fn to_semver(self) -> CargoResult<Version> {
match Version::parse(self.trim()) {
Ok(v) => Ok(v),
Err(..) => Err(anyhow::format_err!("cannot parse '{}' as a semver", self)),
Err(..) => Err(anyhow::format_err!(
"cannot parse '{}' as a SemVer version",
self
)),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/install_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ fn ambiguous_version_no_longer_allowed() {
cargo_process("install foo --version=1.0")
.with_stderr(
"\
[ERROR] invalid value '1.0' for '--version <VERSION>': cannot parse '1.0' as a semver
[ERROR] invalid value '1.0' for '--version <VERSION>': cannot parse '1.0' as a SemVer version
tip: if you want to specify SemVer range, add an explicit qualifier, like '^1.0'
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/pkgid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ error: invalid package ID specification: `two-ver@0`
<tab>Did you mean `two-ver`?
Caused by:
cannot parse '0' as a semver
cannot parse '0' as a SemVer version
",
)
.run();
Expand All @@ -169,7 +169,7 @@ Caused by:
error: invalid package ID specification: `two-ver@0.2`
Caused by:
cannot parse '0.2' as a semver
cannot parse '0.2' as a SemVer version
",
)
.run();
Expand Down

0 comments on commit 9750f51

Please sign in to comment.