Skip to content

Commit b0517cc

Browse files
authored
Fix clippy error and fmt in xz2 encoder.rs
Signed-off-by: Jiahao XU <[email protected]>
1 parent cd0c04f commit b0517cc

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/codec/xz2/encoder.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ impl Encode for Xz2Encoder {
4848

4949
match status {
5050
Status::Ok | Status::StreamEnd => Ok(()),
51-
Status::GetCheck => Err(io::Error::other(
52-
"Unexpected lzma integrity check"
53-
)),
51+
Status::GetCheck => Err(io::Error::other("Unexpected lzma integrity check")),
5452
Status::MemNeeded => Err(io::Error::other("out of memory")),
5553
}
5654
}
@@ -70,11 +68,8 @@ impl Encode for Xz2Encoder {
7068
match status {
7169
Status::Ok => Ok(false),
7270
Status::StreamEnd => Ok(true),
73-
Status::GetCheck => Err(io::Error::new(
74-
io::ErrorKind::Other,
75-
"Unexpected lzma integrity check",
76-
)),
77-
Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")),
71+
Status::GetCheck => Err(io::Error::other("Unexpected lzma integrity check")),
72+
Status::MemNeeded => Err(io::Error::other("out of memory")),
7873
}
7974
}
8075

@@ -93,11 +88,8 @@ impl Encode for Xz2Encoder {
9388
match status {
9489
Status::Ok => Ok(false),
9590
Status::StreamEnd => Ok(true),
96-
Status::GetCheck => Err(io::Error::new(
97-
io::ErrorKind::Other,
98-
"Unexpected lzma integrity check",
99-
)),
100-
Status::MemNeeded => Err(io::Error::new(io::ErrorKind::Other, "out of memory")),
91+
Status::GetCheck => Err(io::Error::other("Unexpected lzma integrity check")),
92+
Status::MemNeeded => Err(io::Error::other("out of memory")),
10193
}
10294
}
10395
}

0 commit comments

Comments
 (0)