Skip to content

Commit df0fc6b

Browse files
committed
Address some of the PR feedback
1 parent 83cec48 commit df0fc6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/module_writer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub trait ModuleWriterExt: ModuleWriter {
101101

102102
/// Creates an empty file at the specified target
103103
fn add_empty_file(&mut self, target: impl AsRef<Path>) -> Result<()> {
104-
self.add_data(target, None, b"".as_slice(), false)
104+
self.add_data(target, None, io::empty(), false)
105105
}
106106
}
107107

@@ -548,8 +548,8 @@ where
548548
W: Write,
549549
{
550550
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
551-
self.hasher.update(buf);
552551
let written = self.inner.write(buf)?;
552+
self.hasher.update(&buf[..written]);
553553
self.bytes_written += written;
554554
Ok(written)
555555
}

0 commit comments

Comments
 (0)