@@ -219,13 +219,8 @@ impl TargetInfo {
219
219
map. insert ( crate_type. clone ( ) , out) ;
220
220
}
221
221
222
- let line = match lines. next ( ) {
223
- Some ( line) => line,
224
- None => anyhow:: bail!(
225
- "output of --print=sysroot missing when learning about \
226
- target-specific information from rustc\n {}",
227
- output_err_info( & process, & output, & error)
228
- ) ,
222
+ let Some ( line) = lines. next ( ) else {
223
+ return error_missing_print_output ( "sysroot" , & process, & output, & error) ;
229
224
} ;
230
225
let sysroot = PathBuf :: from ( line) ;
231
226
let sysroot_host_libdir = if cfg ! ( windows) {
@@ -601,12 +596,8 @@ fn parse_crate_type(
601
596
} ;
602
597
let mut parts = line. trim ( ) . split ( "___" ) ;
603
598
let prefix = parts. next ( ) . unwrap ( ) ;
604
- let suffix = match parts. next ( ) {
605
- Some ( part) => part,
606
- None => anyhow:: bail!(
607
- "output of --print=file-names has changed in the compiler, cannot parse\n {}" ,
608
- output_err_info( cmd, output, error)
609
- ) ,
599
+ let Some ( suffix) = parts. next ( ) else {
600
+ return error_missing_print_output ( "file-names" , cmd, output, error) ;
610
601
} ;
611
602
612
603
Ok ( Some ( ( prefix. to_string ( ) , suffix. to_string ( ) ) ) )
0 commit comments