mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-05 00:57:59 +01:00
remove unnecessary move
This commit is contained in:
parent
9649d0da52
commit
87e0c814af
1 changed files with 3 additions and 3 deletions
|
@ -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()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue