From e090b6fcd6ef903ec1a572266fd2e57b019bb11f Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 3 Feb 2025 12:26:47 -0600 Subject: [PATCH] fix(spec): Don't use 'did you mean' for PackageIdSpec errors --- src/cargo/core/package_id_spec.rs | 2 +- tests/testsuite/pkgid.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cargo/core/package_id_spec.rs b/src/cargo/core/package_id_spec.rs index 35c5437ae..f146214e9 100644 --- a/src/cargo/core/package_id_spec.rs +++ b/src/cargo/core/package_id_spec.rs @@ -77,7 +77,7 @@ impl PackageIdSpecQuery for PackageIdSpec { .filter(|&id| spec.matches(id)) .collect(); 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); } }; diff --git a/tests/testsuite/pkgid.rs b/tests/testsuite/pkgid.rs index cc8b98600..f4471e040 100644 --- a/tests/testsuite/pkgid.rs +++ b/tests/testsuite/pkgid.rs @@ -106,7 +106,7 @@ registry+https://github.com/rust-lang/crates.io-index#crates-io@0.1.0 .with_status(101) .with_stderr_data(str![[r#" [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 @@ -193,7 +193,7 @@ Please re-run this command with one of the following specifications: .with_status(101) .with_stderr_data(str![[r#" [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.2.0