@@ -206,7 +206,7 @@ impl Callbacks for TimePassesCallbacks {
206206 // time because it will mess up the --print output. See #64339.
207207 //
208208 self . time_passes = ( config. opts. prints. is_empty( ) && config. opts. unstable_opts. time_passes)
209- . then ( || config. opts. unstable_opts. time_passes_format) ;
209+ . then_some ( config. opts. unstable_opts. time_passes_format) ;
210210 config. opts. trimmed_def_paths = true ;
211211 }
212212}
@@ -439,8 +439,9 @@ fn make_input(early_dcx: &EarlyDiagCtxt, free_matches: &[String]) -> Option<Inpu
439439 "when UNSTABLE_RUSTDOC_TEST_PATH is set \
440440 UNSTABLE_RUSTDOC_TEST_LINE also needs to be set",
441441 ) ;
442- let line = isize :: from_str_radix( & line, 10 )
443- . expect( "UNSTABLE_RUSTDOC_TEST_LINE needs to be an number" ) ;
442+ let line = line
443+ . parse:: <isize >( )
444+ . expect( "UNSTABLE_RUSTDOC_TEST_LINE needs to be a number" ) ;
444445 FileName :: doc_test_source_code( PathBuf :: from( path) , line)
445446 }
446447 Err ( _) => FileName :: anon_source_code( & input) ,
@@ -474,8 +475,7 @@ fn handle_explain(early_dcx: &EarlyDiagCtxt, registry: Registry, code: &str, col
474475 let mut text = String :: new( ) ;
475476 // Slice off the leading newline and print.
476477 for line in description. lines( ) {
477- let indent_level =
478- line. find( |c: char | !c. is_whitespace( ) ) . unwrap_or_else( || line. len( ) ) ;
478+ let indent_level = line. find( |c: char | !c. is_whitespace( ) ) . unwrap_or( line. len( ) ) ;
479479 let dedented_line = & line[ indent_level..] ;
480480 if dedented_line. starts_with( "```" ) {
481481 is_in_code_block = !is_in_code_block;
@@ -547,7 +547,7 @@ fn show_md_content_with_pager(content: &str, color: ColorConfig) {
547547
548548 // The pager failed. Try to print pretty output to stdout.
549549 if let Some ( ( bufwtr, mdbuf) ) = & pretty_data
550- && bufwtr. print( & mdbuf) . is_ok( )
550+ && bufwtr. print( mdbuf) . is_ok( )
551551 {
552552 return ;
553553 }
@@ -598,8 +598,7 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) {
598598
599599fn list_metadata( sess: & Session , metadata_loader: & dyn MetadataLoader ) {
600600 match sess. io. input {
601- Input :: File ( ref ifile) => {
602- let path = & ( * ifile) ;
601+ Input :: File ( ref path) => {
603602 let mut v = Vec :: new( ) ;
604603 locator:: list_file_metadata(
605604 & sess. target,
@@ -833,7 +832,7 @@ fn print_crate_info(
833832 SupportedCrateTypes => {
834833 let supported_crate_types = CRATE_TYPES
835834 . iter( )
836- . filter( |( _, crate_type) | !invalid_output_for_target( & sess, * crate_type) )
835+ . filter( |( _, crate_type) | !invalid_output_for_target( sess, * crate_type) )
837836 . filter( |( _, crate_type) | * crate_type != CrateType :: Sdylib )
838837 . map( |( crate_type_sym, _) | * crate_type_sym)
839838 . collect:: <BTreeSet <_>>( ) ;
@@ -1434,7 +1433,7 @@ pub fn install_ice_hook(bug_report_url: &'static str, extra_info: fn(&DiagCtxt))
14341433 eprintln!( ) ;
14351434
14361435 if let Some ( ice_path) = ice_path( )
1437- && let Ok ( mut out) = File :: options( ) . create( true ) . append( true ) . open( & ice_path)
1436+ && let Ok ( mut out) = File :: options( ) . create( true ) . append( true ) . open( ice_path)
14381437 {
14391438 // The current implementation always returns `Some`.
14401439 let location = info. location( ) . unwrap( ) ;
@@ -1510,7 +1509,7 @@ fn report_ice(
15101509
15111510 let file = if let Some ( path) = ice_path( ) {
15121511 // Create the ICE dump target file.
1513- match crate :: fs:: File :: options( ) . create( true ) . append( true ) . open( & path) {
1512+ match crate :: fs:: File :: options( ) . create( true ) . append( true ) . open( path) {
15141513 Ok ( mut file) => {
15151514 dcx. emit_note( session_diagnostics:: IcePath { path: path. clone( ) } ) ;
15161515 if FIRST_PANIC . swap( false , Ordering :: SeqCst ) {
0 commit comments