Skip to content

Commit 5c6b3c0

Browse files
authored
Fix encoder.rs
Signed-off-by: Jiahao XU <[email protected]>
1 parent b8f73f6 commit 5c6b3c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/codec/bzip2/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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(|e| io::Error::other(e))?;
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

0 commit comments

Comments
 (0)