Skip to content

Commit 70c7c29

Browse files
committed
fix!: parallel utilities that create thread-state now use FnOnce.
This way, all unnecessary cloning is avoided.
1 parent b009db0 commit 70c7c29

File tree

1 file changed

+2
-2
lines changed
  • gix-features/src/parallel

1 file changed

+2
-2
lines changed

gix-features/src/parallel/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn in_parallel_if<I, S, O, R>(
135135
condition: impl FnOnce() -> bool,
136136
input: impl Iterator<Item = I> + Send,
137137
thread_limit: Option<usize>,
138-
new_thread_state: impl Fn(usize) -> S + Send + Clone,
138+
new_thread_state: impl FnOnce(usize) -> S + Send + Clone,
139139
consume: impl FnMut(I, &mut S) -> O + Send + Clone,
140140
reducer: R,
141141
) -> Result<<R as Reduce>::Output, <R as Reduce>::Error>
@@ -161,7 +161,7 @@ pub fn in_parallel_if<I, S, O, R>(
161161
_condition: impl FnOnce() -> bool,
162162
input: impl Iterator<Item = I>,
163163
thread_limit: Option<usize>,
164-
new_thread_state: impl Fn(usize) -> S,
164+
new_thread_state: impl FnOnce(usize) -> S,
165165
consume: impl FnMut(I, &mut S) -> O,
166166
reducer: R,
167167
) -> Result<<R as Reduce>::Output, <R as Reduce>::Error>

0 commit comments

Comments
 (0)