File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,14 @@ impl DocFS {
9090 let sender = self . errors . sender . clone ( ) . unwrap ( ) ;
9191 rayon:: spawn ( move || match fs:: write ( & path, & contents) {
9292 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+ } ) ;
9696 }
9797 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+ ) ;
101101 }
102102 } ) ;
103103 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ pub fn test_main_static_abort(tests: &[&TestDescAndFn]) {
158158 . filter ( |test| test. desc . name . as_slice ( ) == name)
159159 . map ( make_owned_test)
160160 . 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) ) ;
162162 let TestDescAndFn { desc, testfn } = test;
163163 let testfn = match testfn {
164164 StaticTestFn ( f) => f,
You can’t perform that action at this time.
0 commit comments