Skip to content

Commit

Permalink
Fix requests for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jujumba committed Jul 16, 2024
1 parent c6fc351 commit 9effeb8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ impl<B: BitBlock> BitVec<B> {
/// Inserts a given bit at index `at`, shifting all bits after by one
///
/// # Panics
/// Panics if `at > nbits`
/// Panics if `at` is out of bounds for `BitVec`'s length (that is, if `at > BitVec::len()`)
///
/// # Examples
///```
Expand All @@ -1635,15 +1635,15 @@ impl<B: BitBlock> BitVec<B> {
/// b.push(true);
/// b.insert(1, false);
///
/// assert_eq!(b.len(), 3);
/// assert!(b.eq_vec(&[true, false, true]));
///```
///
/// # Time complexity
/// Takes O([`BitVec::len`]) time. All items after the insertion index must be
/// shifted to the right. In the worst case, all elements are shifted when
/// the insertion index is 0.
///
/// [`BitVec::len`]: Self::len
pub fn insert(&mut self, at: usize, bit: bool) {
assert!(
at <= self.nbits,
Expand Down Expand Up @@ -3180,5 +3180,7 @@ mod tests {
false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, true, false
]));

assert_eq!(v.storage().len(), 3);
}
}

0 comments on commit 9effeb8

Please sign in to comment.