@@ -16,7 +16,7 @@ use std::iter::RandomAccessIterator;
1616use std:: iter:: { Rev , Enumerate , Repeat , Map , Zip } ;
1717use std:: ops;
1818use std:: uint;
19- use std:: vec ;
19+ use std:: slice ;
2020
2121#[ deriving( Clone ) ]
2222struct SmallBitv {
@@ -278,13 +278,13 @@ impl Bitv {
278278 let s =
279279 if init {
280280 if exact {
281- vec :: from_elem ( nelems, !0 u)
281+ slice :: from_elem ( nelems, !0 u)
282282 } else {
283- let mut v = vec :: from_elem ( nelems-1 , !0 u) ;
283+ let mut v = slice :: from_elem ( nelems-1 , !0 u) ;
284284 v. push ( ( 1 <<nbits % uint:: BITS ) -1 ) ;
285285 v
286286 }
287- } else { vec :: from_elem ( nelems, 0 u) } ;
287+ } else { slice :: from_elem ( nelems, 0 u) } ;
288288 Big ( BigBitv :: new ( s) )
289289 } ;
290290 Bitv { rep : rep, nbits : nbits}
@@ -452,7 +452,7 @@ impl Bitv {
452452 * Each `uint` in the resulting vector has either value `0u` or `1u`.
453453 */
454454 pub fn to_vec ( & self ) -> ~[ uint ] {
455- vec :: from_fn ( self . nbits , |x| self . init_to_vec ( x) )
455+ slice :: from_fn ( self . nbits , |x| self . init_to_vec ( x) )
456456 }
457457
458458 /**
@@ -473,7 +473,7 @@ impl Bitv {
473473
474474 let len = self . nbits /8 +
475475 if self . nbits % 8 == 0 { 0 } else { 1 } ;
476- vec :: from_fn ( len, |i|
476+ slice :: from_fn ( len, |i|
477477 bit ( self , i, 0 ) |
478478 bit ( self , i, 1 ) |
479479 bit ( self , i, 2 ) |
@@ -489,7 +489,7 @@ impl Bitv {
489489 * Transform `self` into a `[bool]` by turning each bit into a `bool`.
490490 */
491491 pub fn to_bools ( & self ) -> ~[ bool ] {
492- vec :: from_fn ( self . nbits , |i| self [ i] )
492+ slice :: from_fn ( self . nbits , |i| self [ i] )
493493 }
494494
495495 /**
@@ -879,7 +879,7 @@ impl BitvSet {
879879 /// and w1/w2 are the words coming from the two vectors self, other.
880880 fn commons < ' a > ( & ' a self , other : & ' a BitvSet )
881881 -> Map < ' static , ( ( uint , & ' a uint ) , & ' a ~[ uint ] ) , ( uint , uint , uint ) ,
882- Zip < Enumerate < vec :: Items < ' a , uint > > , Repeat < & ' a ~[ uint ] > > > {
882+ Zip < Enumerate < slice :: Items < ' a , uint > > , Repeat < & ' a ~[ uint ] > > > {
883883 let min = cmp:: min ( self . bitv . storage . len ( ) , other. bitv . storage . len ( ) ) ;
884884 self . bitv . storage . slice ( 0 , min) . iter ( ) . enumerate ( )
885885 . zip ( Repeat :: new ( & other. bitv . storage ) )
@@ -895,7 +895,7 @@ impl BitvSet {
895895 /// `other`.
896896 fn outliers < ' a > ( & ' a self , other : & ' a BitvSet )
897897 -> Map < ' static , ( ( uint , & ' a uint ) , uint ) , ( bool , uint , uint ) ,
898- Zip < Enumerate < vec :: Items < ' a , uint > > , Repeat < uint > > > {
898+ Zip < Enumerate < slice :: Items < ' a , uint > > , Repeat < uint > > > {
899899 let slen = self . bitv . storage . len ( ) ;
900900 let olen = other. bitv . storage . len ( ) ;
901901
@@ -946,7 +946,7 @@ mod tests {
946946 use bitv;
947947
948948 use std:: uint;
949- use std:: vec ;
949+ use std:: slice ;
950950 use rand;
951951 use rand:: Rng ;
952952
@@ -964,7 +964,7 @@ mod tests {
964964 #[test]
965965 fn test_0_elements() {
966966 let act = Bitv::new(0u, false);
967- let exp = vec ::from_elem::<bool>(0u, false);
967+ let exp = slice ::from_elem::<bool>(0u, false);
968968 assert!(act.eq_vec(exp));
969969 }
970970
0 commit comments