Skip to content

Commit 3076f26

Browse files
authored
Rollup merge of #106564 - Folyd:feat-repeatn, r=scottmcm
Change to immutable borrow when cloning element of RepeatN
2 parents 98ad442 + a139fd0 commit 3076f26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/iter/sources/repeat_n.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<A: Clone> Iterator for RepeatN<A> {
126126
// zero so it won't be dropped later, and thus it's okay to take it here.
127127
unsafe { ManuallyDrop::take(&mut self.element) }
128128
} else {
129-
A::clone(&mut self.element)
129+
A::clone(&self.element)
130130
})
131131
}
132132

0 commit comments

Comments
 (0)