Merge rust-bitcoin/rust-bitcoin#4376: primitives: replace error propagation with `expect`
cf42c511d8
primitives: replace error propagation with `expect` (Andrew Poelstra) Pull request description: This error path cannot happen, and if it could, failing formatting is not the correct source of action, because the std docs say that formatting may only fail if the formatter says so. Fixes comment in #4269 ACKs for top commit: tcharding: ACKcf42c511d8
Kixunil: ACKcf42c511d8
Tree-SHA512: 0ad47bb210dc71568bde426b8fd7782a4d48415fbf27133783975117d174b58eb791e68290e53f150a7e65236efda75032852bb6ed30bf4a182f18b9440cfcf9
This commit is contained in:
commit
319e87c07c
|
@ -223,7 +223,7 @@ impl fmt::Display for Header {
|
|||
self.time.to_u32().to_le_bytes().as_hex(),
|
||||
self.bits.to_consensus().to_le_bytes().as_hex(),
|
||||
self.nonce.to_le_bytes().as_hex(),
|
||||
)?;
|
||||
).expect("total length of written objects is 160 characters");
|
||||
fmt::Display::fmt(&buf, f)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue