Skip to content

Commit 30121d8

Browse files
committed
Fix struct field init for 1.13 compat
1 parent 9b938ba commit 30121d8

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/str.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub trait ParallelString {
209209
/// assert_eq!(10, total);
210210
/// ```
211211
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 }
213213
}
214214

215215
/// Returns a parallel iterator over substrings that match a given character
@@ -228,7 +228,7 @@ pub trait ParallelString {
228228
/// assert_eq!(digits, vec![(0, "1"), (3, "2"), (14, "3"), (17, "4")]);
229229
/// ```
230230
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 }
232232
}
233233
}
234234

@@ -707,7 +707,7 @@ impl<'ch, 'pat, P: Pattern> UnindexedProducer for MatchesProducer<'ch, 'pat, P>
707707
let (left, right) = self.chars.split_at(index);
708708
let pattern = self.pattern;
709709
self.chars = left;
710-
(self, Some(MatchesProducer { chars: right, pattern }))
710+
(self, Some(MatchesProducer { chars: right, pattern: pattern }))
711711
} else {
712712
(self, None)
713713
}
@@ -742,7 +742,11 @@ impl<'ch, P: Pattern> ParallelIterator for MatchIndices<'ch, P> {
742742
fn drive_unindexed<C>(self, consumer: C) -> C::Result
743743
where C: UnindexedConsumer<Self::Item>
744744
{
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+
};
746750
bridge_unindexed(producer, consumer)
747751
}
748752
}
@@ -754,10 +758,13 @@ impl<'ch, 'pat, P: Pattern> UnindexedProducer for MatchIndicesProducer<'ch, 'pat
754758
let index = find_char_midpoint(self.chars);
755759
if index > 0 {
756760
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+
};
759766
self.chars = left;
760-
(self, Some(MatchIndicesProducer { index: right_index, chars: right, pattern }))
767+
(self, Some(right_producer))
761768
} else {
762769
(self, None)
763770
}

0 commit comments

Comments
 (0)