remove unnecessary move

This commit is contained in:
Liam 2024-12-01 17:30:18 -05:00
parent 9649d0da52
commit 87e0c814af

View file

@ -53,15 +53,15 @@ pub fn open_writer(path: &str) -> Result<WriterResourceArc, Atom> {
pub fn start_file(writer: WriterResourceArc, name: &str) -> Atom { pub fn start_file(writer: WriterResourceArc, name: &str) -> Atom {
let options = SimpleFileOptions::default().compression_method(CompressionMethod::Deflated); let options = SimpleFileOptions::default().compression_method(CompressionMethod::Deflated);
with_writer(writer, move |writer| { with_writer(writer, |writer| {
writer.as_mut()?.start_file(name, options).ok() writer.as_mut()?.start_file(name, options).ok()
}) })
} }
pub fn write(writer: WriterResourceArc, data: &[u8]) -> Atom { pub fn write(writer: WriterResourceArc, data: &[u8]) -> Atom {
with_writer(writer, move |writer| writer.as_mut()?.write(data).ok()) with_writer(writer, |writer| writer.as_mut()?.write(data).ok())
} }
pub fn finish(writer: WriterResourceArc) -> Atom { pub fn finish(writer: WriterResourceArc) -> Atom {
with_writer(writer, move |writer| writer.take().map(|w| w.finish().ok())) with_writer(writer, |writer| writer.take().map(|w| w.finish().ok()))
} }