Implement Clone for liballoc::collections::linked_list::Cursor.

This commit is contained in:
Charles Lew 2020-04-17 21:10:48 +08:00
parent 861996e138
commit 22e51cd78a

View File

@ -1197,6 +1197,14 @@ pub struct Cursor<'a, T: 'a> {
list: &'a LinkedList<T>,
}
#[unstable(feature = "linked_list_cursors", issue = "58533")]
impl<T> Clone for Cursor<'_, T> {
fn clone(&self) -> Self {
let Cursor { index, current, list } = *self;
Cursor { index, current, list }
}
}
#[unstable(feature = "linked_list_cursors", issue = "58533")]
impl<T: fmt::Debug> fmt::Debug for Cursor<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {