(&mut self, item: T)
| 20 | |
| 21 | impl<const SIZE: usize, T: Copy> Stack<T> for Buffer<SIZE, T> { |
| 22 | fn push(&mut self, item: T) { |
| 23 | if self.tail == (SIZE - 1) { |
| 24 | // Discard the data. we are buffer oerflow. |
| 25 | return; |
| 26 | } |
| 27 | |
| 28 | self.data[self.tail] = item; |
| 29 | self.tail += 1; |
| 30 | } |
| 31 | |
| 32 | fn pop(&mut self) -> Option<T> { |
| 33 | if self.tail == 0 { |
no outgoing calls