Skip to content

Commit 512885d

Browse files
committed
simplify set_all
1 parent 49d9270 commit 512885d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/snapshot_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl<D: SnapshotVecDelegate> SnapshotVec<D> {
150150
/// otherwise equivalent to -- invoking `set` for each element.
151151
pub fn set_all(&mut self, mut new_elems: impl FnMut(usize) -> D::Value) {
152152
if !self.in_snapshot() {
153-
for (slot, index) in self.values.iter_mut().zip(0..) {
153+
for (index, slot) in self.values.iter_mut().enumerate() {
154154
*slot = new_elems(index);
155155
}
156156
} else {

0 commit comments

Comments
 (0)