//! A doubly-linked list with owned nodes.
//!
//! The `DList` allows pushing and popping elements at either end.
-//!
-//! `DList` implements the trait `Deque`. It should be imported with
-//! `use collections::Deque`.
// DList is constructed like a singly-linked list over the field `next`.
// including the last link being None; each Node owns its `next` field.
}
type Link<T> = Option<Box<Node<T>>>;
-struct Rawlink<T> { p: *mut T }
+
+struct Rawlink<T> {
+ p: *mut T,
+}
+
+impl<T> Copy for Rawlink<T> {}
struct Node<T> {
next: Link<T>,
fn clone(&self) -> Items<'a, T> { *self }
}
+impl<'a,T> Copy for Items<'a,T> {}
+
/// An iterator over mutable references to the items of a `DList`.
pub struct MutItems<'a, T:'a> {
list: &'a mut DList<T>,