From e0f497cb8974b137165e334120f756616b39bfd2 Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Tue, 11 Apr 2023 22:03:09 -0400 Subject: [PATCH] Writer for tar nodes takes `&self` instead of `self` --- src/tar/node.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tar/node.rs b/src/tar/node.rs index 6d31e14..e618910 100644 --- a/src/tar/node.rs +++ b/src/tar/node.rs @@ -23,11 +23,11 @@ impl Node { /// Write out a single file within the tar to a file or something with a /// ``std::io::Write`` trait. - pub fn write(self, mut input: T) -> Result { + pub fn write(&self, mut input: T) -> Result { input.write_all(&self.header.to_bytes()?)?; let mut written = 512; - for d in self.data { - input.write_all(&d)?; + for d in &self.data { + input.write_all(d)?; written += d.len(); }