fn append(&mut self, data: Data) -> usize {
    let mut next = 0;
    let mut prev = 0;
    let n = self.list.len();
    let non_empty = (self.first < n) && self.list[self.first].is_some();
    if non_empty {
      let node_first = self.list[self.first].as_mut().unwrap();
      let cur_prev = node_first.prev;
      next = self.first;
      prev = cur_prev;
      node_first.prev = n;
      self.list[cur_prev].as_mut().unwrap().next = n;
    } else {
      debug_assert_eq!(self.first, 0);
    }
    self.list.push(Some(Node {
      data: data,
      next: next,
      prev: prev,
    }));
    n
  }
// inserts data between last and first, becoming the new last
inserts data between last and first, becoming the new last
inserts data between last and first becoming the new last
fn append(&mut self, data: Data) -> usize {
    let mut next = 0;
    let mut prev = 0;
    let n = self.list.len();
    let non_empty = (self.first < n) && self.list[self.first].is_some();
    if non_empty {
      let node_first = self.list[self.first].as_mut().unwrap();
      let cur_prev = node_first.prev;
      next = self.first;
      prev = cur_prev;
      node_first.prev = n;
      self.list[cur_prev].as_mut().unwrap().next = n;
    } else {
      debug_assert_eq!(self.first, 0);
    }
    self.list.push(Some(Node {
      data: data,
      next: next,
      prev: prev,
    }));
    n
  }
fn append ( & mut self , data : Data ) -> usize { let mut next = 0 ; let mut prev = 0 ; let n = self . list . len ( ) ; let non_empty = ( self . first < n ) && self . list [ self . first ] . is_some ( ) ; if non_empty { let node_first = self . list [ self . first ] . as_mut ( ) . unwrap ( ) ; let cur_prev = node_first . prev ; next = self . first ; prev = cur_prev ; node_first . prev = n ; self . list [ cur_prev ] . as_mut ( ) . unwrap ( ) . next = n ; } else { debug_assert_eq ! ( self first 0 ) ; } self . list . push ( Some ( Node { data : data , next : next , prev : prev , } ) ) ; n }
inserts data between last and first, becoming the new last
inserts data between last and first becoming the new last
&mut self
data
Data