Skip to content

Commit 22e51cd

Browse files
committedApr 17, 2020
Implement Clone for liballoc::collections::linked_list::Cursor.
1 parent 861996e commit 22e51cd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/liballoc/collections/linked_list.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,14 @@ pub struct Cursor<'a, T: 'a> {
11971197
list: &'a LinkedList<T>,
11981198
}
11991199

1200+
#[unstable(feature = "linked_list_cursors", issue = "58533")]
1201+
impl<T> Clone for Cursor<'_, T> {
1202+
fn clone(&self) -> Self {
1203+
let Cursor { index, current, list } = *self;
1204+
Cursor { index, current, list }
1205+
}
1206+
}
1207+
12001208
#[unstable(feature = "linked_list_cursors", issue = "58533")]
12011209
impl<T: fmt::Debug> fmt::Debug for Cursor<'_, T> {
12021210
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)
Please sign in to comment.