Skip to content

Commit 8218f8c

Browse files
authored
Merge pull request #119 from Jujumba/fix_args_name
fix arg name in `with_capacity` and `from_elem`
2 parents 83f6838 + 5e3725d commit 8218f8c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ impl BitVec<u32> {
321321
/// }
322322
/// ```
323323
#[inline]
324-
pub fn from_elem(nbits: usize, bit: bool) -> Self {
325-
let nblocks = blocks_for_bits::<B>(nbits);
324+
pub fn from_elem(len: usize, bit: bool) -> Self {
325+
let nblocks = blocks_for_bits::<B>(len);
326326
let mut bit_vec = BitVec {
327327
storage: vec![if bit { !B::zero() } else { B::zero() }; nblocks],
328-
nbits,
328+
nbits: len,
329329
};
330330
bit_vec.fix_last_block();
331331
bit_vec
@@ -339,9 +339,9 @@ impl BitVec<u32> {
339339
/// It is important to note that this function does not specify the
340340
/// *length* of the returned bitvector, but only the *capacity*.
341341
#[inline]
342-
pub fn with_capacity(nbits: usize) -> Self {
342+
pub fn with_capacity(capacity: usize) -> Self {
343343
BitVec {
344-
storage: Vec::with_capacity(blocks_for_bits::<B>(nbits)),
344+
storage: Vec::with_capacity(blocks_for_bits::<B>(capacity)),
345345
nbits: 0,
346346
}
347347
}

0 commit comments

Comments
 (0)