File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,7 @@ fn should_skip_module<T: FormatHandler>(
91
91
}
92
92
93
93
fn echo_back_stdin ( input : & str ) -> Result < FormatReport , ErrorKind > {
94
- if let Err ( e) = io:: stdout ( ) . write_all ( input. as_bytes ( ) ) {
95
- return Err ( From :: from ( e) ) ;
96
- }
94
+ io:: stdout ( ) . write_all ( input. as_bytes ( ) ) ?;
97
95
Ok ( FormatReport :: new ( ) )
98
96
}
99
97
Original file line number Diff line number Diff line change @@ -751,7 +751,8 @@ fn idempotent_check(
751
751
752
752
let target = sig_comments. get ( "target" ) . map ( |x| & ( * x) [ ..] ) ;
753
753
754
- handle_result ( write_result, target) . map ( |_| format_report)
754
+ handle_result ( write_result, target) ?;
755
+ Ok ( format_report)
755
756
}
756
757
757
758
// Reads test config file using the supplied (optional) file name. If there's no file name or the
Original file line number Diff line number Diff line change @@ -872,8 +872,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
872
872
// Extract leading `use ...;`.
873
873
let items: Vec < _ > = stmts
874
874
. iter ( )
875
- . take_while ( |stmt| stmt. to_item ( ) . map_or ( false , is_use_item) )
876
- . filter_map ( |stmt| stmt. to_item ( ) )
875
+ . map_while ( |stmt| stmt. to_item ( ) . filter ( |i| is_use_item ( i) ) )
877
876
. collect ( ) ;
878
877
879
878
if items. is_empty ( ) {
You can’t perform that action at this time.
0 commit comments