mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-06 13:44:13 +00:00
Apply clippy::needless_return suggestions
This commit is contained in:
parent
b7ad3f9fc4
commit
7f4aba40fc
@ -1309,7 +1309,7 @@ impl<I> DoubleEndedIterator for Peekable<I> where I: DoubleEndedIterator {
|
||||
Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Ok=B>
|
||||
{
|
||||
match self.peeked.take() {
|
||||
Some(None) => return Try::from_ok(init),
|
||||
Some(None) => Try::from_ok(init),
|
||||
Some(Some(v)) => match self.iter.try_rfold(init, &mut f).into_result() {
|
||||
Ok(acc) => f(acc, v),
|
||||
Err(e) => {
|
||||
@ -1326,7 +1326,7 @@ impl<I> DoubleEndedIterator for Peekable<I> where I: DoubleEndedIterator {
|
||||
where Fold: FnMut(Acc, Self::Item) -> Acc,
|
||||
{
|
||||
match self.peeked {
|
||||
Some(None) => return init,
|
||||
Some(None) => init,
|
||||
Some(Some(v)) => {
|
||||
let acc = self.iter.rfold(init, &mut fold);
|
||||
fold(acc, v)
|
||||
|
Loading…
Reference in New Issue
Block a user