Skip to content

Commit 981ea84

Browse files
committed
refactor(compile): Make unmatched_packages optional
1 parent 02ec8d4 commit 981ea84

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cargo/ops/cargo_compile/unit_generator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,16 +294,16 @@ impl<'a> UnitGenerator<'a, '_> {
294294

295295
let unmatched_packages = match self.spec {
296296
Packages::Default | Packages::OptOut(_) | Packages::All(_) => {
297-
"default-run packages".to_owned()
297+
" in default-run packages".to_owned()
298298
}
299299
Packages::Packages(packages) => {
300300
let first = packages
301301
.first()
302302
.expect("The number of packages must be at least 1");
303303
if packages.len() == 1 {
304-
format!("`{}` package", first)
304+
format!(" in `{}` package", first)
305305
} else {
306-
format!("`{}`, ... packages", first)
306+
format!(" in `{}`, ... packages", first)
307307
}
308308
}
309309
};
@@ -313,7 +313,7 @@ impl<'a> UnitGenerator<'a, '_> {
313313
let mut msg = String::new();
314314
write!(
315315
msg,
316-
"no {target_desc} target {named} `{target_name}` in {unmatched_packages}{suggestion}",
316+
"no {target_desc} target {named} `{target_name}`{unmatched_packages}{suggestion}",
317317
)?;
318318
if !targets_elsewhere.is_empty() {
319319
append_targets_elsewhere(&mut msg)?;

0 commit comments

Comments
 (0)