(&mut self, val: A::Item)
| 711 | /// ``` |
| 712 | #[inline(always)] |
| 713 | pub fn try_push(&mut self, val: A::Item) -> Option<A::Item> { |
| 714 | debug_assert!(self.len as usize <= A::CAPACITY); |
| 715 | |
| 716 | let itemref = match self.data.as_slice_mut().get_mut(self.len as usize) { |
| 717 | None => return Some(val), |
| 718 | Some(x) => x, |
| 719 | }; |
| 720 | |
| 721 | *itemref = val; |
| 722 | self.len += 1; |
| 723 | return None; |
| 724 | } |
| 725 | |
| 726 | /// Removes the item at `index`, shifting all others down by one index. |
| 727 | /// |
no test coverage detected