Advertisement
LemmingAvalanche

move_out_of_array

Jul 15th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.26 KB | None | 0 0
  1.     pub fn pop(&mut self) -> Option<T> {
  2.         if self.is_empty() {
  3.             None
  4.         } else {
  5.             self.len -= 1;
  6.             Some( self.array[self.len] ) // error: cannot move out of type `[T; 8]`, a non-copy fixed-size array
  7.         }
  8.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement