We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2334202 commit 03c5955Copy full SHA for 03c5955
src/libcollections/bitv.rs
@@ -415,10 +415,7 @@ impl Bitv {
415
pub fn all(&self) -> bool {
416
match self.rep {
417
Small(ref b) => b.all(self.nbits),
418
- _ => {
419
- for i in self.iter() { if !i { return false; } }
420
- true
421
- }
+ _ => self.iter().all(|x| x)
422
}
423
424
@@ -436,10 +433,7 @@ impl Bitv {
436
433
pub fn none(&self) -> bool {
437
434
438
435
Small(ref b) => b.none(self.nbits),
439
- Big(_) => {
440
- for i in self.iter() { if i { return false; } }
441
442
+ _ => self.iter().all(|x| !x)
443
444
445
0 commit comments