Skip to content

Commit a139fd0

Browse files
committed
Change to immutable borrow when cloning element of RepeatN
1 parent d72b7d2 commit a139fd0

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)