diff options
| author | HampusM <hampus@hampusmat.com> | 2024-08-26 20:16:52 +0200 | 
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2024-08-26 20:16:52 +0200 | 
| commit | 0639ef032fd979762657eb48fea3f20cfc5ba1c2 (patch) | |
| tree | 0707ff0df7aaad8950146730fa61d484d6783802 /src | |
| parent | 0fc3ba4563895f5437faa2b20a5e93b615dbf25d (diff) | |
feat: add function to get if is empty
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 6 | 
1 files changed, 6 insertions, 0 deletions
| @@ -127,6 +127,12 @@ where          self.capacity      } +    /// Returns whether this `MultiVec` is empty. +    pub fn is_empty(&self) -> bool +    { +        self.length == 0 +    } +      fn grow_amortized(&mut self, additional: usize)      {          let required_cap = self.capacity.checked_add(additional).unwrap(); | 
