From a139fd06277dd714b5244fcbb621488e1da2d518 Mon Sep 17 00:00:00 2001 From: Folyd Date: Sat, 7 Jan 2023 23:50:07 +0800 Subject: [PATCH] Change to immutable borrow when cloning element of RepeatN --- library/core/src/iter/sources/repeat_n.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/iter/sources/repeat_n.rs b/library/core/src/iter/sources/repeat_n.rs index fd8d25ce1a55e..dc61d6065b8ed 100644 --- a/library/core/src/iter/sources/repeat_n.rs +++ b/library/core/src/iter/sources/repeat_n.rs @@ -126,7 +126,7 @@ impl Iterator for RepeatN { // 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) }) }