fixup! Add error variant for when not all bytes are written
This commit is contained in:
parent
1e4b2e0adb
commit
00c390f56b
|
@ -48,7 +48,7 @@ pub fn to_vec(data: &Data) -> Result<Vec<u8>> {
|
|||
pub fn to_writer<W: Write>(data: &Data, writer: W) -> Result<()> {
|
||||
let mut buf_writer = BufWriter::new(writer);
|
||||
let vec = to_vec(data)?;
|
||||
if vec.len() != !buf_writer.write(&vec)? {
|
||||
if vec.len() != buf_writer.write(&vec)? {
|
||||
Err(crate::Error::NotAllBytesWritten)
|
||||
} else {
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in New Issue