@@ -49,7 +49,7 @@ pub fn build_thread() -> std::thread::Builder {
4949pub fn in_parallel < I , S , O , R > (
5050 input : impl Iterator < Item = I > + Send ,
5151 thread_limit : Option < usize > ,
52- new_thread_state : impl Fn ( usize ) -> S + Send + Clone ,
52+ new_thread_state : impl FnOnce ( usize ) -> S + Send + Clone ,
5353 consume : impl FnMut ( I , & mut S ) -> O + Send + Clone ,
5454 mut reducer : R ,
5555) -> Result < <R as Reduce >:: Output , <R as Reduce >:: Error >
@@ -117,7 +117,7 @@ where
117117pub fn in_parallel_with_slice < I , S , R , E > (
118118 input : & mut [ I ] ,
119119 thread_limit : Option < usize > ,
120- new_thread_state : impl FnMut ( usize ) -> S + Send + Clone ,
120+ new_thread_state : impl FnOnce ( usize ) -> S + Send + Clone ,
121121 consume : impl FnMut ( & mut I , & mut S , & AtomicIsize , & AtomicBool ) -> Result < ( ) , E > + Send + Clone ,
122122 mut periodic : impl FnMut ( ) -> Option < std:: time:: Duration > + Send ,
123123 state_to_rval : impl FnOnce ( S ) -> R + Send + Clone ,
@@ -168,7 +168,7 @@ where
168168 std:: thread:: Builder :: new ( )
169169 . name ( format ! ( "gitoxide.in_parallel_with_slice.produce.{thread_id}" ) )
170170 . spawn_scoped ( s, {
171- let mut new_thread_state = new_thread_state. clone ( ) ;
171+ let new_thread_state = new_thread_state. clone ( ) ;
172172 let state_to_rval = state_to_rval. clone ( ) ;
173173 let mut consume = consume. clone ( ) ;
174174 let input = Input ( input as * mut [ I ] ) ;
0 commit comments