Skip to content

Commit

Permalink
Update bit_array.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Jan 20, 2024
1 parent b56dc57 commit 471092d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bit_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl BitArray {
&self.0
}

/// Sets the i-th byte
/// Sets the i-th bit
pub fn set(&mut self, idx: usize, val: bool) {
let byte_idx = idx / 8;
let byte = self.0.get_mut(byte_idx).expect("should be in bounds");
Expand All @@ -49,7 +49,7 @@ impl BitArray {
*byte = set_bit(*byte, bit_idx, val);
}

/// Gets the i-th byte
/// Gets the i-th bit
#[must_use]
pub fn get(&self, idx: usize) -> bool {
let byte_idx = idx / 8;
Expand Down

0 comments on commit 471092d

Please sign in to comment.