@@ -209,7 +209,7 @@ pub trait ParallelString {
209
209
/// assert_eq!(10, total);
210
210
/// ```
211
211
fn par_matches < P : Pattern > ( & self , pattern : P ) -> Matches < P > {
212
- Matches { chars : self . as_parallel_string ( ) , pattern }
212
+ Matches { chars : self . as_parallel_string ( ) , pattern : pattern }
213
213
}
214
214
215
215
/// Returns a parallel iterator over substrings that match a given character
@@ -228,7 +228,7 @@ pub trait ParallelString {
228
228
/// assert_eq!(digits, vec![(0, "1"), (3, "2"), (14, "3"), (17, "4")]);
229
229
/// ```
230
230
fn par_match_indices < P : Pattern > ( & self , pattern : P ) -> MatchIndices < P > {
231
- MatchIndices { chars : self . as_parallel_string ( ) , pattern }
231
+ MatchIndices { chars : self . as_parallel_string ( ) , pattern : pattern }
232
232
}
233
233
}
234
234
@@ -707,7 +707,7 @@ impl<'ch, 'pat, P: Pattern> UnindexedProducer for MatchesProducer<'ch, 'pat, P>
707
707
let ( left, right) = self . chars . split_at ( index) ;
708
708
let pattern = self . pattern ;
709
709
self . chars = left;
710
- ( self , Some ( MatchesProducer { chars : right, pattern } ) )
710
+ ( self , Some ( MatchesProducer { chars : right, pattern : pattern } ) )
711
711
} else {
712
712
( self , None )
713
713
}
@@ -742,7 +742,11 @@ impl<'ch, P: Pattern> ParallelIterator for MatchIndices<'ch, P> {
742
742
fn drive_unindexed < C > ( self , consumer : C ) -> C :: Result
743
743
where C : UnindexedConsumer < Self :: Item >
744
744
{
745
- let producer = MatchIndicesProducer { index : 0 , chars : self . chars , pattern : & self . pattern } ;
745
+ let producer = MatchIndicesProducer {
746
+ index : 0 ,
747
+ chars : self . chars ,
748
+ pattern : & self . pattern ,
749
+ } ;
746
750
bridge_unindexed ( producer, consumer)
747
751
}
748
752
}
@@ -754,10 +758,13 @@ impl<'ch, 'pat, P: Pattern> UnindexedProducer for MatchIndicesProducer<'ch, 'pat
754
758
let index = find_char_midpoint ( self . chars ) ;
755
759
if index > 0 {
756
760
let ( left, right) = self . chars . split_at ( index) ;
757
- let right_index = self . index + index;
758
- let pattern = self . pattern ;
761
+ let right_producer = MatchIndicesProducer {
762
+ index : self . index + index,
763
+ chars : right,
764
+ pattern : self . pattern ,
765
+ } ;
759
766
self . chars = left;
760
- ( self , Some ( MatchIndicesProducer { index : right_index , chars : right , pattern } ) )
767
+ ( self , Some ( right_producer ) )
761
768
} else {
762
769
( self , None )
763
770
}
0 commit comments