Same as [`std::vec::Vec::push`] but returns an error on allocation failure.
(&mut self, value: T)
| 153 | /// Same as [`std::vec::Vec::push`] but returns an error on allocation |
| 154 | /// failure. |
| 155 | pub fn push(&mut self, value: T) -> Result<(), OutOfMemory> { |
| 156 | self.reserve(1)?; |
| 157 | self.inner.push(value); |
| 158 | Ok(()) |
| 159 | } |
| 160 | |
| 161 | /// Same as [`std::vec::Vec::pop`]. |
| 162 | pub fn pop(&mut self) -> Option<T> { |