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

View File

@ -92,7 +92,10 @@ impl Package {
to_string_pretty(self, cfg) 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() { if !outdir.exists() {
fs::create_dir_all(outdir)?; fs::create_dir_all(outdir)?;
} }