@@ -271,7 +271,7 @@ impl BitVector {
271271 ///
272272 /// ```
273273 #[ must_use]
274- pub fn ones ( & self ) -> BitVectorBitPositionsIter < true > {
274+ pub fn ones ( & self ) -> BitVectorBitPositionsIter < ' _ , true > {
275275 BitVectorBitPositionsIter :: new ( cast_to_u64_slice ( & self . data ) , self . n_bits )
276276 }
277277
@@ -289,7 +289,7 @@ impl BitVector {
289289 /// assert_eq!(v, vec![63, 128, 129, 254, 1026]);
290290 /// ```
291291 #[ must_use]
292- pub fn ones_with_pos ( & self , pos : usize ) -> BitVectorBitPositionsIter < true > {
292+ pub fn ones_with_pos ( & self , pos : usize ) -> BitVectorBitPositionsIter < ' _ , true > {
293293 BitVectorBitPositionsIter :: with_pos ( cast_to_u64_slice ( & self . data ) , self . n_bits , pos)
294294 }
295295
@@ -308,13 +308,13 @@ impl BitVector {
308308 /// assert_eq!(v, negate_vector(&vv));
309309 /// ```
310310 #[ must_use]
311- pub fn zeros ( & self ) -> BitVectorBitPositionsIter < false > {
311+ pub fn zeros ( & self ) -> BitVectorBitPositionsIter < ' _ , false > {
312312 BitVectorBitPositionsIter :: new ( cast_to_u64_slice ( & self . data ) , self . n_bits )
313313 }
314314
315315 /// Returns a non-consuming iterator over positions of bits set to 0 in the bit vector, starting at a specified bit position.
316316 #[ must_use]
317- pub fn zeros_with_pos ( & self , pos : usize ) -> BitVectorBitPositionsIter < false > {
317+ pub fn zeros_with_pos ( & self , pos : usize ) -> BitVectorBitPositionsIter < ' _ , false > {
318318 BitVectorBitPositionsIter :: with_pos ( cast_to_u64_slice ( & self . data ) , self . n_bits , pos)
319319 }
320320
@@ -337,7 +337,7 @@ impl BitVector {
337337 /// assert_eq!(iter.next(), Some(true)); // Sixth bit is true
338338 /// assert_eq!(iter.next(), None); // End of the iterator
339339 /// ```
340- pub fn iter ( & self ) -> BitVectorIter {
340+ pub fn iter ( & self ) -> BitVectorIter < ' _ > {
341341 BitVectorIter {
342342 data : cast_to_u64_slice ( & self . data ) ,
343343 n_bits : self . n_bits ,
@@ -447,7 +447,7 @@ impl AccessBin for BitVector {
447447 /// assert_eq!(bv.get(1), Some(false));
448448 /// assert_eq!(bv.get(10), None);
449449 /// ```
450- # [ must_use ]
450+
451451 #[ inline( always) ]
452452 fn get ( & self , index : usize ) -> Option < bool > {
453453 if index >= self . len ( ) {
@@ -470,7 +470,7 @@ impl AccessBin for BitVector {
470470 ///
471471 /// assert_eq!(unsafe{bv.get_unchecked(5)}, true);
472472 /// ```
473- # [ must_use ]
473+
474474 #[ inline( always) ]
475475 unsafe fn get_unchecked ( & self , index : usize ) -> bool {
476476 BitVectorMut :: get_bit_slice ( cast_to_u64_slice ( & self . data ) , index)
@@ -535,7 +535,6 @@ where
535535 V : MyPrimInt ,
536536 <V as TryInto < usize > >:: Error : std:: fmt:: Debug ,
537537{
538- #[ must_use]
539538 fn from_iter < T > ( iter : T ) -> Self
540539 where
541540 T : IntoIterator < Item = V > ,
@@ -822,7 +821,7 @@ impl BitVectorMut {
822821 /// ```
823822 #[ must_use]
824823 pub fn with_capacity ( n_bits : usize ) -> Self {
825- let capacity = ( n_bits + 63 ) / 64 ;
824+ let capacity = n_bits. div_ceil ( 64 ) ;
826825 Self {
827826 data : Vec :: with_capacity ( capacity) ,
828827 ..Self :: default ( )
@@ -954,7 +953,7 @@ impl BitVectorMut {
954953 #[ inline]
955954 pub fn extend_with_zeros ( & mut self , n : usize ) {
956955 self . n_bits += n;
957- let new_size = ( self . n_bits + 511 ) / 512 ;
956+ let new_size = self . n_bits . div_ceil ( 512 ) ;
958957 self . data . resize_with ( new_size, Default :: default) ;
959958 }
960959
@@ -1179,7 +1178,7 @@ impl BitVectorMut {
11791178 /// assert_eq!(v, vv);
11801179 /// ```
11811180 #[ must_use]
1182- pub fn ones ( & self ) -> BitVectorBitPositionsIter < true > {
1181+ pub fn ones ( & self ) -> BitVectorBitPositionsIter < ' _ , true > {
11831182 BitVectorBitPositionsIter :: new ( cast_to_u64_slice ( & self . data ) , self . n_bits )
11841183 }
11851184
@@ -1197,7 +1196,7 @@ impl BitVectorMut {
11971196 /// assert_eq!(v, vec![63, 128, 129, 254, 1026]);
11981197 /// ```
11991198 #[ must_use]
1200- pub fn ones_with_pos ( & self , pos : usize ) -> BitVectorBitPositionsIter < true > {
1199+ pub fn ones_with_pos ( & self , pos : usize ) -> BitVectorBitPositionsIter < ' _ , true > {
12011200 BitVectorBitPositionsIter :: with_pos ( cast_to_u64_slice ( & self . data ) , self . n_bits , pos)
12021201 }
12031202
@@ -1216,13 +1215,13 @@ impl BitVectorMut {
12161215 /// assert_eq!(v, negate_vector(&vv));
12171216 /// ```
12181217 #[ must_use]
1219- pub fn zeros ( & self ) -> BitVectorBitPositionsIter < false > {
1218+ pub fn zeros ( & self ) -> BitVectorBitPositionsIter < ' _ , false > {
12201219 BitVectorBitPositionsIter :: new ( cast_to_u64_slice ( & self . data ) , self . n_bits )
12211220 }
12221221
12231222 /// Returns a non-consuming iterator over positions of bits set to 0 in the bit vector, starting at a specified bit position.
12241223 #[ must_use]
1225- pub fn zeros_with_pos ( & self , pos : usize ) -> BitVectorBitPositionsIter < false > {
1224+ pub fn zeros_with_pos ( & self , pos : usize ) -> BitVectorBitPositionsIter < ' _ , false > {
12261225 BitVectorBitPositionsIter :: with_pos ( cast_to_u64_slice ( & self . data ) , self . n_bits , pos)
12271226 }
12281227
@@ -1245,7 +1244,7 @@ impl BitVectorMut {
12451244 /// assert_eq!(iter.next(), Some(true)); // Sixth bit is true
12461245 /// assert_eq!(iter.next(), None); // End of the iterator
12471246 /// ```
1248- pub fn iter ( & self ) -> BitVectorIter {
1247+ pub fn iter ( & self ) -> BitVectorIter < ' _ > {
12491248 BitVectorIter {
12501249 data : cast_to_u64_slice ( & self . data ) ,
12511250 n_bits : self . n_bits ,
@@ -1357,7 +1356,7 @@ impl AccessBin for BitVectorMut {
13571356 /// assert_eq!(bv.get(8), Some(false));
13581357 /// assert_eq!(bv.get(10), None);
13591358 /// ```
1360- # [ must_use ]
1359+
13611360 #[ inline( always) ]
13621361 fn get ( & self , index : usize ) -> Option < bool > {
13631362 if index >= self . len ( ) {
@@ -1379,7 +1378,7 @@ impl AccessBin for BitVectorMut {
13791378 /// bv.extend_with_zeros(10);
13801379 /// assert_eq!(unsafe{bv.get_unchecked(8)}, false);
13811380 /// ```
1382- # [ must_use ]
1381+
13831382 #[ inline( always) ]
13841383 unsafe fn get_unchecked ( & self , index : usize ) -> bool {
13851384 Self :: get_bit_slice ( cast_to_u64_slice ( & self . data ) , index)
0 commit comments