Skip to content

Commit

Permalink
Avoid extra &mut in Chain::fold and try_fold
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Apr 7, 2020
1 parent 2c4cffd commit ce8abc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/iter/adapters/chain.rs
Expand Up @@ -84,7 +84,7 @@ where
self.a = None;
}
if let Some(ref mut b) = self.b {
acc = b.try_fold(acc, &mut f)?;
acc = b.try_fold(acc, f)?;
self.b = None;
}
Try::from_ok(acc)
Expand All @@ -98,7 +98,7 @@ where
acc = a.fold(acc, &mut f);
}
if let Some(b) = self.b {
acc = b.fold(acc, &mut f);
acc = b.fold(acc, f);
}
acc
}
Expand Down

0 comments on commit ce8abc6

Please sign in to comment.