Skip to content

Commit ae8bb98

Browse files
committed
Rename Fuzzy to Alternatives
1 parent 4e22e35 commit ae8bb98

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

crates/resolver-tests/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub fn resolve_with_config_raw(
112112
for summary in self.list.iter() {
113113
let matched = match kind {
114114
QueryKind::Exact => dep.matches(summary),
115-
QueryKind::Fuzzy => true,
115+
QueryKind::Alternatives => true,
116116
QueryKind::Normalized => true,
117117
};
118118
if matched {

src/cargo/core/resolver/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub(super) fn activation_error(
305305
// Maybe the user mistyped the name? Like `dep-thing` when `Dep_Thing`
306306
// was meant. So we try asking the registry for a `fuzzy` search for suggestions.
307307
let candidates = loop {
308-
match registry.query_vec(&new_dep, QueryKind::Fuzzy) {
308+
match registry.query_vec(&new_dep, QueryKind::Alternatives) {
309309
Poll::Ready(Ok(candidates)) => break candidates,
310310
Poll::Ready(Err(e)) => return to_resolve_err(e),
311311
Poll::Pending => match registry.block_until_ready() {

src/cargo/sources/directory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<'cfg> Source for DirectorySource<'cfg> {
108108
let packages = self.packages.values().map(|p| &p.0);
109109
let matches = packages.filter(|pkg| match kind {
110110
QueryKind::Exact => dep.matches(pkg.summary()),
111-
QueryKind::Fuzzy => true,
111+
QueryKind::Alternatives => true,
112112
QueryKind::Normalized => dep.matches(pkg.summary()),
113113
});
114114
for summary in matches.map(|pkg| pkg.summary().clone()) {

src/cargo/sources/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ impl<'cfg> Source for PathSource<'cfg> {
554554
for s in self.packages.iter().map(|p| p.summary()) {
555555
let matched = match kind {
556556
QueryKind::Exact => dep.matches(s),
557-
QueryKind::Fuzzy => true,
557+
QueryKind::Alternatives => true,
558558
QueryKind::Normalized => dep.matches(s),
559559
};
560560
if matched {

src/cargo/sources/registry/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {
792792
.query_inner(dep.package_name(), &req, &mut *self.ops, &mut |s| {
793793
let matched = match kind {
794794
QueryKind::Exact => dep.matches(s.as_summary()),
795-
QueryKind::Fuzzy => true,
795+
QueryKind::Alternatives => true,
796796
QueryKind::Normalized => true,
797797
};
798798
if !matched {
@@ -832,7 +832,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {
832832
return Poll::Ready(Ok(()));
833833
}
834834
let mut any_pending = false;
835-
if kind == QueryKind::Fuzzy || kind == QueryKind::Normalized {
835+
if kind == QueryKind::Alternatives || kind == QueryKind::Normalized {
836836
// Attempt to handle misspellings by searching for a chain of related
837837
// names to the original name. The resolver will later
838838
// reject any candidates that have the wrong name, and with this it'll

src/cargo/sources/source.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub enum QueryKind {
179179
/// Path/Git sources may return all dependencies that are at that URI,
180180
/// whereas an `Registry` source may return dependencies that have the same
181181
/// canonicalization.
182-
Fuzzy,
182+
Alternatives,
183183
/// Match a denpendency in all ways and will normalize the package name.
184184
/// Each source defines what normalizing means.
185185
Normalized,

0 commit comments

Comments
 (0)