Rollup merge of #106564 - Folyd:feat-repeatn, r=scottmcm

Change to immutable borrow when cloning element of RepeatN
This commit is contained in:
Matthias Krüger 2023-01-07 20:43:23 +01:00 committed by GitHub
commit 3076f26988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,7 +126,7 @@ fn next(&mut self) -> Option<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)
})
}