Skip to content

fix arg name in with_capacity and from_elem #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ impl BitVec<u32> {
/// }
/// ```
#[inline]
pub fn from_elem(nbits: usize, bit: bool) -> Self {
let nblocks = blocks_for_bits::<B>(nbits);
pub fn from_elem(len: usize, bit: bool) -> Self {
let nblocks = blocks_for_bits::<B>(len);
let mut bit_vec = BitVec {
storage: vec![if bit { !B::zero() } else { B::zero() }; nblocks],
nbits,
nbits: len,
};
bit_vec.fix_last_block();
bit_vec
Expand All @@ -339,9 +339,9 @@ impl BitVec<u32> {
/// It is important to note that this function does not specify the
/// *length* of the returned bitvector, but only the *capacity*.
#[inline]
pub fn with_capacity(nbits: usize) -> Self {
pub fn with_capacity(capacity: usize) -> Self {
BitVec {
storage: Vec::with_capacity(blocks_for_bits::<B>(nbits)),
storage: Vec::with_capacity(blocks_for_bits::<B>(capacity)),
nbits: 0,
}
}
Expand Down
Loading