Rollup merge of #44559 - frewsxcv:frewsxcv-rm-loop, r=sfackler
Remove unneeded `loop`. None
This commit is contained in:
@@ -1110,15 +1110,13 @@ impl<'a, T: Ord> Iterator for Union<'a, T> {
|
|||||||
type Item = &'a T;
|
type Item = &'a T;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<&'a T> {
|
fn next(&mut self) -> Option<&'a T> {
|
||||||
loop {
|
|
||||||
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
|
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
|
||||||
Less => return self.a.next(),
|
Less => self.a.next(),
|
||||||
Equal => {
|
Equal => {
|
||||||
self.b.next();
|
self.b.next();
|
||||||
return self.a.next();
|
self.a.next()
|
||||||
}
|
|
||||||
Greater => return self.b.next(),
|
|
||||||
}
|
}
|
||||||
|
Greater => self.b.next(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user