File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -2331,16 +2331,14 @@ fn deprecated_underscore<T>(
2331
2331
edition : Edition ,
2332
2332
warnings : & mut Vec < String > ,
2333
2333
) -> CargoResult < ( ) > {
2334
+ let old_path = new_path. replace ( "-" , "_" ) ;
2334
2335
if old. is_some ( ) && Edition :: Edition2024 <= edition {
2335
- let old_path = new_path. replace ( "-" , "_" ) ;
2336
2336
anyhow:: bail!( "`{old_path}` is unsupported as of the 2024 edition; instead use `{new_path}`\n (in the `{name}` {kind})" ) ;
2337
2337
} else if old. is_some ( ) && new. is_some ( ) {
2338
- let old_path = new_path. replace ( "-" , "_" ) ;
2339
2338
warnings. push ( format ! (
2340
2339
"`{old_path}` is redundant with `{new_path}`, preferring `{new_path}` in the `{name}` {kind}"
2341
2340
) )
2342
2341
} else if old. is_some ( ) {
2343
- let old_path = new_path. replace ( "-" , "_" ) ;
2344
2342
warnings. push ( format ! (
2345
2343
"`{old_path}` is deprecated in favor of `{new_path}` and will not work in the 2024 edition\n (in the `{name}` {kind})"
2346
2344
) )
You can’t perform that action at this time.
0 commit comments