Skip to content

Commit 6657d70

Browse files
committed
Rename Fuzzy to Alternatives
1 parent 6042ee5 commit 6657d70

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

crates/resolver-tests/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub fn resolve_with_config_raw(
111111
for summary in self.list.iter() {
112112
let matched = match kind {
113113
QueryKind::Exact => dep.matches(summary),
114-
QueryKind::Fuzzy => true,
114+
QueryKind::Alternatives => true,
115115
QueryKind::Normalized => true,
116116
};
117117
if matched {

src/cargo/core/resolver/errors.rs

Lines changed: 1 addition & 1 deletion
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/ops/cargo_add/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ fn get_latest_dependency(
584584
}
585585
MaybeWorkspace::Other(query) => {
586586
let possibilities = loop {
587-
match registry.query_vec(&query, QueryKind::Fuzzy) {
587+
match registry.query_vec(&query, QueryKind::Alternatives) {
588588
std::task::Poll::Ready(res) => {
589589
break res?;
590590
}

src/cargo/sources/directory.rs

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {
781781
.query_inner(dep.package_name(), &req, &mut *self.ops, &mut |s| {
782782
let matched = match kind {
783783
QueryKind::Exact => dep.matches(s.as_summary()),
784-
QueryKind::Fuzzy => true,
784+
QueryKind::Alternatives => true,
785785
QueryKind::Normalized => true,
786786
};
787787
// Next filter out all yanked packages. Some yanked packages may
@@ -798,7 +798,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {
798798
return Poll::Ready(Ok(()));
799799
}
800800
let mut any_pending = false;
801-
if kind == QueryKind::Fuzzy {
801+
if kind == QueryKind::Alternatives {
802802
// Attempt to handle misspellings by searching for a chain of related
803803
// names to the original name. The resolver will later
804804
// reject any candidates that have the wrong name, and with this it'll

src/cargo/sources/source.rs

Lines changed: 1 addition & 1 deletion
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)