From 3b88759665d045b30a1e282a5adc73f701ef4f1e Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Mon, 27 Mar 2023 03:26:51 -0400 Subject: [PATCH] Cleaned up imports from previous commit --- src/creator/mod.rs | 40 +++++++++++++++++++--------------------- src/package/mod.rs | 5 ++++- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/creator/mod.rs b/src/creator/mod.rs index b9303b4..2879e4d 100644 --- a/src/creator/mod.rs +++ b/src/creator/mod.rs @@ -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(()) } } diff --git a/src/package/mod.rs b/src/package/mod.rs index 23e2227..4f14ca6 100644 --- a/src/package/mod.rs +++ b/src/package/mod.rs @@ -92,7 +92,10 @@ impl Package { to_string_pretty(self, cfg) } - pub(crate) fn save_ron_and_create_tar_node(&self, outdir: &Path) -> Result> { + pub(crate) fn save_ron_and_create_tar_node( + &self, + outdir: &Path, + ) -> Result> { if !outdir.exists() { fs::create_dir_all(outdir)?; }