File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,14 @@ impl DocFS {
90
90
let sender = self . errors . sender . clone ( ) . unwrap ( ) ;
91
91
rayon:: spawn ( move || match fs:: write ( & path, & contents) {
92
92
Ok ( _) => {
93
- sender
94
- . send ( None )
95
- . expect ( & format ! ( "failed to send error on \" {} \" " , path . display ( ) ) ) ;
93
+ sender. send ( None ) . unwrap_or_else ( |_| {
94
+ panic ! ( "failed to send error on \" {} \" " , path . display ( ) )
95
+ } ) ;
96
96
}
97
97
Err ( e) => {
98
- sender
99
- . send ( Some ( format ! ( "\" {}\" : {} " , path. display( ) , e ) ) )
100
- . expect ( & format ! ( "failed to send non-error on \" {} \" " , path . display ( ) ) ) ;
98
+ sender. send ( Some ( format ! ( " \" {} \" : {}" , path . display ( ) , e ) ) ) . unwrap_or_else (
99
+ |_| panic ! ( "failed to send non-error on \" {}\" " , path. display( ) ) ,
100
+ ) ;
101
101
}
102
102
} ) ;
103
103
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ pub fn test_main_static_abort(tests: &[&TestDescAndFn]) {
158
158
. filter ( |test| test. desc . name . as_slice ( ) == name)
159
159
. map ( make_owned_test)
160
160
. next ( )
161
- . expect ( & format ! ( "couldn't find a test with the provided name '{}'" , name) ) ;
161
+ . unwrap_or_else ( || panic ! ( "couldn't find a test with the provided name '{}'" , name) ) ;
162
162
let TestDescAndFn { desc, testfn } = test;
163
163
let testfn = match testfn {
164
164
StaticTestFn ( f) => f,
You can’t perform that action at this time.
0 commit comments