@@ -57,7 +57,7 @@ impl BzEncoder {
5757 let status = self
5858 . compress
5959 . compress ( input. unwritten ( ) , output. unwritten_mut ( ) , action)
60- . map_err ( |e| io:: Error :: new ( io :: ErrorKind :: Other , e ) ) ?;
60+ . map_err ( io:: Error :: other ) ?;
6161
6262 input. advance ( ( self . compress . total_in ( ) - prior_in) as usize ) ;
6363 output. advance ( ( self . compress . total_out ( ) - prior_out) as usize ) ;
@@ -90,7 +90,7 @@ impl Encode for BzEncoder {
9090
9191 // There was insufficient memory in the input or output buffer to complete
9292 // the request, but otherwise everything went normally.
93- Status :: MemNeeded => Err ( io:: Error :: new ( io :: ErrorKind :: Other , "out of memory" ) ) ,
93+ Status :: MemNeeded => Err ( io:: Error :: other ( "out of memory" ) ) ,
9494 }
9595 }
9696
@@ -116,7 +116,7 @@ impl Encode for BzEncoder {
116116
117117 // There was insufficient memory in the input or output buffer to complete
118118 // the request, but otherwise everything went normally.
119- Status :: MemNeeded => Err ( io:: Error :: new ( io :: ErrorKind :: Other , "out of memory" ) ) ,
119+ Status :: MemNeeded => Err ( io:: Error :: other ( "out of memory" ) ) ,
120120 }
121121 }
122122
@@ -142,7 +142,7 @@ impl Encode for BzEncoder {
142142
143143 // There was insufficient memory in the input or output buffer to complete
144144 // the request, but otherwise everything went normally.
145- Status :: MemNeeded => Err ( io:: Error :: new ( io :: ErrorKind :: Other , "out of memory" ) ) ,
145+ Status :: MemNeeded => Err ( io:: Error :: other ( "out of memory" ) ) ,
146146 }
147147 }
148148}
0 commit comments