about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFolyd <lyshuhow@gmail.com>2023-01-07 23:50:07 +0800
committerFolyd <lyshuhow@gmail.com>2023-01-07 23:50:07 +0800
commita139fd06277dd714b5244fcbb621488e1da2d518 (patch)
tree84f8e0862b0e19baa34bee20bf1224afb7ab7ada
parentd72b7d2d2a64f5f77b919a1428873b4d4149f60d (diff)
downloadrust-a139fd06277dd714b5244fcbb621488e1da2d518.tar.gz
rust-a139fd06277dd714b5244fcbb621488e1da2d518.zip
Change to immutable borrow when cloning element of RepeatN
-rw-r--r--library/core/src/iter/sources/repeat_n.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/iter/sources/repeat_n.rs b/library/core/src/iter/sources/repeat_n.rs
index fd8d25ce1a5..dc61d6065b8 100644
--- a/library/core/src/iter/sources/repeat_n.rs
+++ b/library/core/src/iter/sources/repeat_n.rs
@@ -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)
         })
     }