Compare commits

..

2 Commits

View File

@ -23,11 +23,11 @@ impl Node {
/// Write out a single file within the tar to a file or something with a /// Write out a single file within the tar to a file or something with a
/// ``std::io::Write`` trait. /// ``std::io::Write`` trait.
pub fn write<T: io::Write>(self, mut input: T) -> Result<usize, Error> { pub fn write<T: io::Write>(&self, mut input: T) -> Result<usize, Error> {
input.write_all(&self.header.to_bytes()?)?; input.write_all(&self.header.to_bytes()?)?;
let mut written = 512; let mut written = 512;
for d in self.data { for d in &self.data {
input.write_all(&d)?; input.write_all(d)?;
written += d.len(); written += d.len();
} }