Avoid extra &mut in Chain::fold and try_fold

This commit is contained in:
Josh Stone 2020-04-07 16:58:52 -07:00
parent 2c4cffde3b
commit ce8abc63a7

View file

@ -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)
@ -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
}