diff --git a/src/creator/mod.rs b/src/creator/mod.rs index c6423bd..4c7a5be 100644 --- a/src/creator/mod.rs +++ b/src/creator/mod.rs @@ -1,8 +1,6 @@ -use hpk_package::deku::DekuError; - use { crate::{Item, ItemError, Package, Plist, Specs}, - hpk_package::{tar, Entry}, + hpk_package::{deku::DekuError, tar, Entry}, rayon::prelude::{IntoParallelRefIterator, ParallelIterator}, std::{ borrow::BorrowMut, diff --git a/src/installer/mod.rs b/src/installer/mod.rs index 1c26d18..7d40a82 100644 --- a/src/installer/mod.rs +++ b/src/installer/mod.rs @@ -100,9 +100,9 @@ impl Installer { pr_node.write(writer)?; let path = &self.path; let package = &self.package; - let sender = Mutex::new(sender); let hooks = Mutex::new(hooks); - archive.nodes.par_iter().try_for_each(|node| { + let s = sender.clone(); + archive.nodes.par_iter().try_for_each_with(s, |sender, node| { let mut path = path.clone(); let fpath = node.header.file_path()?; if let Some(s) = node.header.prefix() { @@ -153,7 +153,7 @@ impl Installer { } } let msg = extract_entry(entry, node, path)?; - sender.lock().unwrap().send(msg)?; + sender.send(msg)?; Ok::<(), InstallError>(()) })?; Ok(hooks.into_inner()?) @@ -252,6 +252,7 @@ fn pop_pinstall( } mod error { + use crate::Hooks; use hpk_package::tar; use std::{ error::Error, @@ -262,9 +263,6 @@ mod error { PoisonError, }, }; - - use crate::Hooks; - use super::InstallMessage; #[derive(Debug)]