File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ impl crate::OutgoingMessage for OutgoingMessage {
6969 let tmp = * self ;
7070 let OutgoingMessage { message, mut sender} = tmp;
7171 let m = Rc :: new ( message) ;
72- ( Promise :: from_future ( sender. send ( m. clone ( ) ) . map_err ( |e| e . into ( ) ) ) , m)
72+ ( Promise :: from_future ( sender. send ( m. clone ( ) ) ) , m)
7373 }
7474
7575 fn take ( self : Box < Self > )
@@ -162,7 +162,7 @@ impl <T> crate::Connection<crate::rpc_twoparty_capnp::Side> for Connection<T>
162162 }
163163
164164 fn shutdown ( & mut self , result : :: capnp:: Result < ( ) > ) -> Promise < ( ) , :: capnp:: Error > {
165- Promise :: from_future ( self . inner . borrow_mut ( ) . sender . terminate ( result) . map_err ( |e| e . into ( ) ) )
165+ Promise :: from_future ( self . inner . borrow_mut ( ) . sender . terminate ( result) )
166166 }
167167}
168168
Original file line number Diff line number Diff line change @@ -17,13 +17,12 @@ pub trait Read {
1717
1818 fn read_exact ( & mut self , mut buf : & mut [ u8 ] ) -> Result < ( ) > {
1919 while !buf. is_empty ( ) {
20- match self . read ( buf) {
21- Ok ( 0 ) => break ,
22- Ok ( n ) => {
20+ match self . read ( buf) ? {
21+ 0 => break ,
22+ n => {
2323 let tmp = buf;
2424 buf = & mut tmp[ n..] ;
2525 }
26- Err ( e) => return Err ( e. into ( ) ) ,
2726 }
2827 }
2928 if !buf. is_empty ( ) {
You can’t perform that action at this time.
0 commit comments