Cleaned up imports from previous commit

This commit is contained in:
Nathan Fisher 2023-03-27 03:26:51 -04:00
parent 39b8664c9e
commit 3b88759665
2 changed files with 23 additions and 22 deletions

View File

@ -1,24 +1,21 @@
use std::{
borrow::BorrowMut,
fs::File,
io::Write,
sync::{
atomic::{AtomicUsize, Ordering},
mpsc::{self, Receiver},
Mutex,
},
};
use rayon::prelude::{IntoParallelRefIterator, ParallelIterator};
use walkdir::WalkDir;
use zstd::Encoder;
use crate::{Entry, Item, Plist, Package};
use {
crate::Specs,
std::{env, error::Error, io, path::Path, sync::mpsc::Sender},
walkdir::DirEntry,
crate::{Entry, Item, Package, Plist, Specs},
rayon::prelude::{IntoParallelRefIterator, ParallelIterator},
std::{
borrow::BorrowMut,
env,
error::Error,
fs::File,
io::{self, Write},
path::Path,
sync::{
atomic::{AtomicUsize, Ordering},
mpsc::{self, Receiver, Sender},
Mutex,
},
},
walkdir::{DirEntry, WalkDir},
zstd::Encoder,
};
pub enum Message {
@ -109,7 +106,8 @@ impl Creator {
let mut writer = writer.into_inner()?;
writer.write_all(&node.to_vec()?)?;
let _fd = writer.finish()?;
self.sender.send(Message::Success(format!("{} saved", archive.display())))?;
self.sender
.send(Message::Success(format!("{} saved", archive.display())))?;
Ok(())
}
}

View File

@ -92,7 +92,10 @@ impl Package {
to_string_pretty(self, cfg)
}
pub(crate) fn save_ron_and_create_tar_node(&self, outdir: &Path) -> Result<Node, Box<dyn Error>> {
pub(crate) fn save_ron_and_create_tar_node(
&self,
outdir: &Path,
) -> Result<Node, Box<dyn Error>> {
if !outdir.exists() {
fs::create_dir_all(outdir)?;
}