fix(spec): Don't use 'did you mean' for PackageIdSpec errors

This commit is contained in:
Ed Page 2025-02-03 12:26:47 -06:00
parent 759178e42b
commit e090b6fcd6
2 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ impl PackageIdSpecQuery for PackageIdSpec {
.filter(|&id| spec.matches(id)) .filter(|&id| spec.matches(id))
.collect(); .collect();
if !try_matches.is_empty() { if !try_matches.is_empty() {
suggestion.push_str("\nDid you mean one of these?\n"); suggestion.push_str("\nhelp: there are similar package ID specifications:\n");
minimize(suggestion, &try_matches, self); minimize(suggestion, &try_matches, self);
} }
}; };

View File

@ -106,7 +106,7 @@ registry+https://github.com/rust-lang/crates.io-index#crates-io@0.1.0
.with_status(101) .with_status(101)
.with_stderr_data(str![[r#" .with_stderr_data(str![[r#"
[ERROR] package ID specification `https://example.com/crates-io` did not match any packages [ERROR] package ID specification `https://example.com/crates-io` did not match any packages
Did you mean one of these? [HELP] there are similar package ID specifications:
crates-io@0.1.0 crates-io@0.1.0
@ -193,7 +193,7 @@ Please re-run this command with one of the following specifications:
.with_status(101) .with_status(101)
.with_stderr_data(str![[r#" .with_stderr_data(str![[r#"
[ERROR] package ID specification `two-ver@0.3.0` did not match any packages [ERROR] package ID specification `two-ver@0.3.0` did not match any packages
Did you mean one of these? [HELP] there are similar package ID specifications:
two-ver@0.1.0 two-ver@0.1.0
two-ver@0.2.0 two-ver@0.2.0