Skip to content

Commit b9ff307

Browse files
committed
Merge rust-bitcoin/rust-miniscript#489: replaced if else return with mapping
480c3fd41741f7716adb1869c5208573dc8564a0 replaced if else return with mapping (BufferOverflow) Pull request description: Fixes #479 ACKs for top commit: apoelstra: ACK 480c3fd41741f7716adb1869c5208573dc8564a0 Tree-SHA512: 6b7384217ea1dbc621b26ca86fb2d6f9aa44f190b0b3abd20b5b4c8d1c659a274d3aab86223d58594d8a68ef34764f444d48c79f16e010c021351187c1b6b32e
2 parents 4efb89f + b7357cf commit b9ff307

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/descriptor/checksum.rs

Lines changed: 1 addition & 5 deletions
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)