Writer for tar nodes takes &self
instead of self
This commit is contained in:
parent
407d12a711
commit
e0f497cb89
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user