Skip to content

Commit 61210a0

Browse files
committed
Merge #489: replaced if else return with mapping
480c3fd replaced if else return with mapping (BufferOverflow) Pull request description: Fixes #479 ACKs for top commit: apoelstra: ACK 480c3fd Tree-SHA512: 6b7384217ea1dbc621b26ca86fb2d6f9aa44f190b0b3abd20b5b4c8d1c659a274d3aab86223d58594d8a68ef34764f444d48c79f16e010c021351187c1b6b32e
2 parents fd9ef55 + 480c3fd commit 61210a0

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)