Skip to content

Commit 480c3fd

Browse files
committed
replaced if else return with mapping
1 parent fd9ef55 commit 480c3fd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/descriptor/checksum.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ impl<'f, 'a> Formatter<'f, 'a> {
166166
impl<'f, 'a> fmt::Write for Formatter<'f, 'a> {
167167
fn write_str(&mut self, s: &str) -> fmt::Result {
168168
self.fmt.write_str(s)?;
169-
if self.eng.input(s).is_ok() {
170-
Ok(())
171-
} else {
172-
Err(fmt::Error)
173-
}
169+
self.eng.input(s).map_err(|_| fmt::Error)
174170
}
175171
}
176172

0 commit comments

Comments
 (0)