MCPcopy Create free account
hub / github.com/Lokathor/tinyvec / pop

Method pop

src/arrayvec.rs:666–675  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

664 /// ```
665 #[inline]
666 pub fn pop(&mut self) -> Option<A::Item> {
667 if self.len > 0 {
668 self.len -= 1;
669 let out =
670 core::mem::take(&mut self.data.as_slice_mut()[self.len as usize]);
671 Some(out)
672 } else {
673 None
674 }
675 }
676
677 /// Place an element onto the end of the vec.
678 ///

Callers 1

swap_removeMethod · 0.45

Calls 1

as_slice_mutMethod · 0.45

Tested by

no test coverage detected