Skip to content

Commit

Permalink
Change to immutable borrow when cloning element of RepeatN
Browse files Browse the repository at this point in the history
  • Loading branch information
Folyd committed Jan 7, 2023
1 parent d72b7d2 commit a139fd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/iter/sources/repeat_n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl<A: Clone> Iterator for RepeatN<A> {
// zero so it won't be dropped later, and thus it's okay to take it here.
unsafe { ManuallyDrop::take(&mut self.element) }
} else {
A::clone(&mut self.element)
A::clone(&self.element)
})
}

Expand Down

0 comments on commit a139fd0

Please sign in to comment.