File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed
src/cargo/ops/cargo_compile Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -307,24 +307,16 @@ impl<'a> UnitGenerator<'a, '_> {
307
307
let named = if is_glob { "matches pattern" } else { "named" } ;
308
308
309
309
let mut msg = String :: new ( ) ;
310
- if !suggestion . is_empty ( ) {
311
- write ! (
312
- msg ,
313
- "no {target_desc} target {named} `{target_name}` in {unmatched_packages}{suggestion}" ,
314
- ) ? ;
310
+ write ! (
311
+ msg ,
312
+ "no {target_desc} target {named} `{target_name}` in {unmatched_packages}{suggestion}" ,
313
+ ) ? ;
314
+ if !targets_elsewhere . is_empty ( ) {
315
315
append_targets_elsewhere ( & mut msg) ?;
316
- } else {
317
- write ! (
318
- msg,
319
- "no {target_desc} target {named} `{target_name}` in {unmatched_packages}" ,
320
- ) ?;
321
-
322
- append_targets_elsewhere ( & mut msg) ?;
323
- if !targets. is_empty ( ) && targets_elsewhere. is_empty ( ) {
324
- write ! ( msg, "\n Available {} targets:" , target_desc) ?;
325
- for target in targets {
326
- write ! ( msg, "\n {}" , target. name( ) ) ?;
327
- }
316
+ } else if suggestion. is_empty ( ) && !targets. is_empty ( ) {
317
+ write ! ( msg, "\n Available {} targets:" , target_desc) ?;
318
+ for target in targets {
319
+ write ! ( msg, "\n {}" , target. name( ) ) ?;
328
320
}
329
321
}
330
322
anyhow:: bail!( msg) ;
You can’t perform that action at this time.
0 commit comments