File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -285,11 +285,7 @@ pub(super) fn activation_error(
285
285
. collect ( ) ;
286
286
candidates. sort_by_key ( |o| o. 0 ) ;
287
287
let mut msg = format ! (
288
- "no matching package named `{}` found\n \
289
- location searched: {}\n ",
290
- dep. package_name( ) ,
291
- dep. source_id( )
292
- ) ;
288
+ "no matching package named `{}` found\n " , dep. package_name( ) ) ;
293
289
if !candidates. is_empty ( ) {
294
290
// If dependency package name is equal to the name of the candidate here
295
291
// it may be a prerelease package which hasn't been specified correctly
@@ -312,8 +308,9 @@ pub(super) fn activation_error(
312
308
if candidates. len ( ) > 3 {
313
309
names. push ( "..." ) ;
314
310
}
315
-
316
- msg. push_str ( "perhaps you meant: " ) ;
311
+ // Vertically align first suggestion with missing crate name
312
+ // so the silly typo you probably made jumps out at you.
313
+ msg. push_str ( "perhaps you meant: " ) ;
317
314
msg. push_str ( & names. iter ( ) . enumerate ( ) . fold (
318
315
String :: default ( ) ,
319
316
|acc, ( i, el) | match i {
@@ -323,9 +320,9 @@ pub(super) fn activation_error(
323
320
} ,
324
321
) ) ;
325
322
}
326
-
327
323
msg. push ( '\n' ) ;
328
324
}
325
+ msg. push_str ( & format ! ( "location searched: {}\n " , dep. source_id( ) ) ) ;
329
326
msg. push_str ( "required by " ) ;
330
327
msg. push_str ( & describe_path (
331
328
& cx. parents . path_to_bottom ( & parent. package_id ( ) ) ,
You can’t perform that action at this time.
0 commit comments