From 5cfc8f52bd51f2f9129e813da351d0ac6c9bec34 Mon Sep 17 00:00:00 2001 From: Truman Kilen Date: Mon, 20 Jan 2025 18:49:45 -0600 Subject: [PATCH] ParallelPakWriter can be moved into closure --- repak/src/pak.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repak/src/pak.rs b/repak/src/pak.rs index 030e8a9..d39df21 100644 --- a/repak/src/pak.rs +++ b/repak/src/pak.rs @@ -294,7 +294,7 @@ impl PakWriter { pub fn parallel<'scope, F, E>(&mut self, f: F) -> Result<&mut Self, E> where - F: Send + Sync + FnOnce(&mut ParallelPakWriter<'scope>) -> Result<(), E>, + F: Send + Sync + FnOnce(ParallelPakWriter<'scope>) -> Result<(), E>, E: From + Send, { use pariter::IteratorExt as _; @@ -303,7 +303,7 @@ impl PakWriter { pariter::scope(|scope: &pariter::Scope<'_>| -> Result<(), E> { let (tx, rx) = std::sync::mpsc::sync_channel(0); - let handle = scope.spawn(|_| f(&mut ParallelPakWriter { tx })); + let handle = scope.spawn(|_| f(ParallelPakWriter { tx })); let result = rx .into_iter()