We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b480cd commit 5055d4bCopy full SHA for 5055d4b
src/liballoc/collections/linked_list.rs
@@ -1203,8 +1203,8 @@ impl<T: Clone> Clone for LinkedList<T> {
1203
if self.len() > other.len() {
1204
self.split_off(other.len());
1205
}
1206
- for elem in self.iter_mut() {
1207
- elem.clone_from(iter_other.next().unwrap());
+ for (elem, elem_other) in self.iter_mut().zip(&mut iter_other) {
+ elem.clone_from(elem_other);
1208
1209
if !iter_other.is_empty() {
1210
self.extend(iter_other.cloned());
0 commit comments