diff --git a/src/lib.rs b/src/lib.rs index beb28e4..9cf5728 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -407,6 +407,26 @@ impl<'a, T> Populator<'a, T> None } } + + /// Returns a slice of all the elements + /// + /// # Panics + /// If the collection was not full. + #[inline] + pub fn completed_ref(&self) -> &[T] + { + self.try_completed_ref().expect("Collection was not fully populated") + } + + /// Returns a mutable slice of all the elements + /// + /// # Panics + /// If the collection was not full. + #[inline] + pub fn completed_mut(&mut self) -> &[T] + { + self.try_completed_mut().expect("Collection was not fully populated") + } /// If all values are populated, returns a mutable slice of all the elements. ///