// This function adds a new node to the end of the list.
This function adds a new node to the end of the list.
This function adds a new node to the end of the list .
pub fn push_back(&mut self, t: T) {
        // Create the new node, and make it a raw pointer.
        let new = Box::new( Node { data: t, next: ptr::null_mut(), prev: self.last } );
        let new = box_into_raw(new);
        // Update other pointers to this node.
        if self.last.is_null() {
            debug_assert!(self.first.is_null());
            // The list is currently empty, so we have to update the head pointer.
            unimplemented!()
        } else {
            debug_assert!(!self.first.is_null());
            // We have to update the `next` pointer of the tail node.
            unimplemented!()
        }
        // Make this the last node.
        self.last = new;
    }
pub fn push_back ( & mut self , t : T ) { // Create the new node, and make it a raw pointer. let new = Box :: new ( Node { data : t , next : ptr :: null_mut ( ) , prev : self . last } ) ; let new = box_into_raw ( new ) ; // Update other pointers to this node. if self . last . is_null ( ) { debug_assert ! ( self first is_null ( ) ) ; // The list is currently empty, so we have to update the head pointer. unimplemented ! ( ) } else { debug_assert ! ( self first is_null ( ) ) ; // We have to update the `next` pointer of the tail node. unimplemented ! ( ) } // Make this the last node. self . last = new ; }
This function adds a new node to the end of the list.
This function adds a new node to the end of the list .
&mut self
t
T