@@ -68,11 +68,7 @@ fn get_file_set(matches: &clap::ArgMatches) -> Option<FileSet> {
68
68
}
69
69
70
70
fn notify_fast_mode ( ) {
71
- writeln ! (
72
- :: std:: io:: stderr( ) ,
73
- "Fast mode activated. Sit back, relax, and enjoy the brief flight."
74
- )
75
- . expect ( "error writing to stderr" ) ;
71
+ eprintln ! ( "Fast mode activated. Sit back, relax, and enjoy the brief flight." ) ;
76
72
}
77
73
78
74
fn slurp ( path : & Path ) -> Result < String > {
@@ -468,8 +464,7 @@ impl Fastmod {
468
464
// interactive input from a human, so we simply can't use
469
465
// *that* much memory in modern terms.
470
466
for error in errors {
471
- writeln ! ( :: std:: io:: stderr( ) , "{}" , display_warning( & error) )
472
- . expect ( "error writing to stderr" ) ;
467
+ eprintln ! ( "{}" , display_warning( & error) ) ;
473
468
}
474
469
} ) ;
475
470
@@ -571,8 +566,7 @@ impl Fastmod {
571
566
let changed_files = changed_files_inner. clone ( ) ;
572
567
Box :: new ( move |result| {
573
568
if let Err ( error) = result {
574
- writeln ! ( :: std:: io:: stderr( ) , "Warning: {}" , & error)
575
- . expect ( "error writing to stderr" ) ;
569
+ eprintln ! ( "Warning: {}" , & error) ;
576
570
return WalkState :: Continue ;
577
571
}
578
572
let dirent = result. unwrap ( ) ;
@@ -591,8 +585,7 @@ impl Fastmod {
591
585
}
592
586
let slurped = slurp ( path) ;
593
587
if let Err ( error) = slurped {
594
- writeln ! ( :: std:: io:: stderr( ) , "{}" , display_warning( & error) )
595
- . expect ( "error writing to stderr" ) ;
588
+ eprintln ! ( "{}" , display_warning( & error) ) ;
596
589
return WalkState :: Continue ;
597
590
}
598
591
let contents = slurped. expect ( "checked for error above" ) ;
@@ -604,8 +597,7 @@ impl Fastmod {
604
597
changed_files. push ( path. to_owned ( ) )
605
598
}
606
599
}
607
- Err ( error) => writeln ! ( :: std:: io:: stderr( ) , "{}" , display_warning( & error) )
608
- . expect ( "error writing to stderr" ) ,
600
+ Err ( error) => eprintln ! ( "{}" , display_warning( & error) ) ,
609
601
}
610
602
}
611
603
WalkState :: Continue
@@ -784,7 +776,7 @@ compatibility with the original codemod.",
784
776
785
777
fn main ( ) {
786
778
if let Err ( e) = fastmod ( ) {
787
- write ! ( :: std :: io :: stderr ( ) , "{:?}" , e) . expect ( "Couldn't write to stderr" ) ;
779
+ eprint ! ( "{:?}" , e) ;
788
780
}
789
781
}
790
782
0 commit comments