Skip to content

Commit eb0daec

Browse files
committed
refactor(resolver): Group related alternatives logic
1 parent 31a884e commit eb0daec

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/cargo/core/resolver/errors.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,18 @@ pub(super) fn activation_error(
313313
},
314314
}
315315
};
316-
317316
let mut name_candidates: Vec<_> = name_candidates
318317
.into_iter()
319318
.map(|s| s.into_summary())
320319
.collect();
321-
322320
name_candidates.sort_unstable_by_key(|a| a.name());
323321
name_candidates.dedup_by(|a, b| a.name() == b.name());
324322
let mut name_candidates: Vec<_> = name_candidates
325323
.iter()
326324
.filter_map(|n| Some((edit_distance(&*new_dep.package_name(), &*n.name(), 3)?, n)))
327325
.collect();
328326
name_candidates.sort_by_key(|o| o.0);
327+
329328
let mut msg: String;
330329
if name_candidates.is_empty() {
331330
msg = format!("no matching package named `{}` found\n", dep.package_name());

0 commit comments

Comments
 (0)