File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/cargo/ops/cargo_compile Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -287,8 +287,9 @@ impl<'a> UnitGenerator<'a, '_> {
287
287
}
288
288
CargoResult :: Ok ( ( ) )
289
289
} ;
290
+
291
+ let mut msg = String :: new ( ) ;
290
292
if !suggestion. is_empty ( ) {
291
- let mut msg = String :: new ( ) ;
292
293
write ! (
293
294
msg,
294
295
"no {} target {} `{}`{}" ,
@@ -298,9 +299,7 @@ impl<'a> UnitGenerator<'a, '_> {
298
299
suggestion,
299
300
) ?;
300
301
append_targets_elsewhere ( & mut msg, "\n " ) ?;
301
- anyhow:: bail!( msg) ;
302
302
} else {
303
- let mut msg = String :: new ( ) ;
304
303
writeln ! (
305
304
msg,
306
305
"no {} target {} `{}`." ,
@@ -316,8 +315,8 @@ impl<'a> UnitGenerator<'a, '_> {
316
315
writeln ! ( msg, " {}" , target. name( ) ) ?;
317
316
}
318
317
}
319
- anyhow:: bail!( msg) ;
320
318
}
319
+ anyhow:: bail!( msg) ;
321
320
}
322
321
Ok ( proposals)
323
322
}
You can’t perform that action at this time.
0 commit comments