Skip to content

Commit ce8abc6

Browse files
committed
Avoid extra &mut in Chain::fold and try_fold
1 parent 2c4cffd commit ce8abc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/iter/adapters/chain.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ where
8484
self.a = None;
8585
}
8686
if let Some(ref mut b) = self.b {
87-
acc = b.try_fold(acc, &mut f)?;
87+
acc = b.try_fold(acc, f)?;
8888
self.b = None;
8989
}
9090
Try::from_ok(acc)
@@ -98,7 +98,7 @@ where
9898
acc = a.fold(acc, &mut f);
9999
}
100100
if let Some(b) = self.b {
101-
acc = b.fold(acc, &mut f);
101+
acc = b.fold(acc, f);
102102
}
103103
acc
104104
}

0 commit comments

Comments
 (0)