@@ -87,7 +87,8 @@ use std::hash;
87
87
88
88
use vec:: Vec ;
89
89
90
- type Blocks < ' a > = Take < Cloned < Items < ' a , u32 > > > ;
90
+ type Blocks < ' a > = Cloned < Items < ' a , u32 > >
91
+ type MutBlocks < ' a > MutItems <' a, u32>;
91
92
type MatchWords < ' a > = Chain < Enumerate < Blocks < ' a > > , Skip < Take < Enumerate < Repeat < u32 > > > > > ;
92
93
93
94
// Take two BitV's, and return iterators of their words, where the shorter one
@@ -196,15 +197,15 @@ impl Bitv {
196
197
}
197
198
198
199
/// Iterator over mutable refs to the underlying blocks of data.
199
- fn blocks_mut ( & mut self ) -> Take < MutItems < u32 > > {
200
+ fn blocks_mut ( & mut self ) -> MutBlocks {
200
201
let blocks = blocks_for_bits ( self . len ( ) ) ;
201
- self . storage . iter_mut ( ) . take ( blocks)
202
+ self . storage [ .. blocks] . iter_mut ( )
202
203
}
203
204
204
205
/// Iterator over the underlying blocks of data
205
- fn blocks ( & self ) -> Take < Cloned < Items < u32 > > > {
206
+ fn blocks ( & self ) -> Blocks {
206
207
let blocks = blocks_for_bits ( self . len ( ) ) ;
207
- self . storage . iter ( ) . cloned ( ) . take ( blocks )
208
+ self . storage [ ..blocks ] . iter ( ) . cloned ( )
208
209
}
209
210
210
211
/// An operation might screw up the unused bits in the last block of the Bitv.
@@ -259,7 +260,7 @@ impl Bitv {
259
260
260
261
/// Constructs a new, empty `Bitv` with the specified capacity.
261
262
///
262
- /// The bitvector will be able to hold exactly `capacity` bits without
263
+ /// The bitvector will be able to hold at least `capacity` bits without
263
264
/// reallocating. If `capacity` is 0, it will not allocate.
264
265
///
265
266
/// It is important to note that this function does not specify the
0 commit comments