mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 07:41:08 +00:00
use write_all instead of write (#488)
io::Write::write is not guaranteed to process the entire buffer. it return how many bytes were processed, which might be smaller than a given buffer’s length. use write_all instead.
This commit is contained in:
@@ -80,7 +80,7 @@ impl Output for Vec<u8> {
|
||||
#[cfg(feature = "std")]
|
||||
impl<W: ::std::io::Write> Output for W {
|
||||
fn write(&mut self, bytes: &[u8]) {
|
||||
(self as &mut ::std::io::Write).write(bytes).expect("Codec outputs are infallible");
|
||||
(self as &mut ::std::io::Write).write_all(bytes).expect("Codec outputs are infallible");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user