File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -469,18 +469,13 @@ pub fn read_conf(sess: &Session) -> Conf {
469
469
470
470
if conf. msrv . is_none ( ) {
471
471
// let's try to get msrv from `Cargo.toml`s field `rust-version`
472
- match MetadataCommand :: new ( ) . no_deps ( ) . exec ( ) {
473
- Ok ( metadata) => {
474
- conf. msrv = metadata
475
- . packages
476
- . get ( 0 )
477
- . and_then ( |x| x. rust_version . as_ref ( ) )
478
- . and_then ( |r| r. comparators . get ( 0 ) )
479
- . map ( |v| format ! ( "{}.{}.{}" , v. major, v. minor. unwrap_or( 0 ) , v. patch. unwrap_or( 0 ) ) ) ;
480
- } ,
481
- Err ( e) => {
482
- sess. struct_err ( & format ! ( "could not read cargo metadata: {}" , e) ) . emit ( ) ;
483
- } ,
472
+ if let Ok ( metadata) = MetadataCommand :: new ( ) . no_deps ( ) . exec ( ) {
473
+ conf. msrv = metadata
474
+ . packages
475
+ . get ( 0 )
476
+ . and_then ( |x| x. rust_version . as_ref ( ) )
477
+ . and_then ( |r| r. comparators . get ( 0 ) )
478
+ . map ( |v| format ! ( "{}.{}.{}" , v. major, v. minor. unwrap_or( 0 ) , v. patch. unwrap_or( 0 ) ) ) ;
484
479
}
485
480
}
486
481
You can’t perform that action at this time.
0 commit comments