Skip to content

Commit efe17de

Browse files
committed
refactor(resolver): Make no alternatives the fall-through
1 parent eb0daec commit efe17de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cargo/core/resolver/errors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,7 @@ pub(super) fn activation_error(
326326
name_candidates.sort_by_key(|o| o.0);
327327

328328
let mut msg: String;
329-
if name_candidates.is_empty() {
330-
msg = format!("no matching package named `{}` found\n", dep.package_name());
331-
} else {
329+
if !name_candidates.is_empty() {
332330
msg = format!(
333331
"no matching package found\nsearched package name: `{}`\n",
334332
dep.package_name()
@@ -354,6 +352,8 @@ pub(super) fn activation_error(
354352
},
355353
));
356354
msg.push('\n');
355+
} else {
356+
msg = format!("no matching package named `{}` found\n", dep.package_name());
357357
}
358358

359359
let mut location_searched_msg = registry.describe_source(dep.source_id());

0 commit comments

Comments
 (0)