Skip to content

Commit 74f8ea2

Browse files
committed
iter: Simplification in rfind's provided implementation
- Prefer simpler constructs instead of going through &mut I's Iterator implementation.
1 parent 29a6a9e commit 74f8ea2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/iter/traits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ pub trait DoubleEndedIterator: Iterator {
467467
Self: Sized,
468468
P: FnMut(&Self::Item) -> bool
469469
{
470-
for x in self.by_ref().rev() {
470+
while let Some(x) = self.next_back() {
471471
if predicate(&x) { return Some(x) }
472472
}
473473
None

0 commit comments

Comments
 (0)