@@ -60,17 +60,17 @@ enum BitvVariant { Big(BigBitv), Small(SmallBitv) }
60
60
/// bv.set(3, true);
61
61
/// bv.set(5, true);
62
62
/// bv.set(7, true);
63
- /// println!("{}", bv.to_str ());
63
+ /// println!("{}", bv.to_string ());
64
64
/// println!("total bits set to true: {}", bv.iter().filter(|x| *x).count());
65
65
///
66
66
/// // flip all values in bitvector, producing non-primes less than 10
67
67
/// bv.negate();
68
- /// println!("{}", bv.to_str ());
68
+ /// println!("{}", bv.to_string ());
69
69
/// println!("total bits set to true: {}", bv.iter().filter(|x| *x).count());
70
70
///
71
71
/// // reset bitvector to empty
72
72
/// bv.clear();
73
- /// println!("{}", bv.to_str ());
73
+ /// println!("{}", bv.to_string ());
74
74
/// println!("total bits set to true: {}", bv.iter().filter(|x| *x).count());
75
75
/// ```
76
76
pub struct Bitv {
@@ -996,10 +996,10 @@ mod tests {
996
996
#[ test]
997
997
fn test_to_str ( ) {
998
998
let zerolen = Bitv :: new ( ) ;
999
- assert_eq ! ( zerolen. to_str ( ) . as_slice( ) , "" ) ;
999
+ assert_eq ! ( zerolen. to_string ( ) . as_slice( ) , "" ) ;
1000
1000
1001
1001
let eightbits = Bitv :: with_capacity ( 8 u, false ) ;
1002
- assert_eq ! ( eightbits. to_str ( ) . as_slice( ) , "00000000" )
1002
+ assert_eq ! ( eightbits. to_string ( ) . as_slice( ) , "00000000" )
1003
1003
}
1004
1004
1005
1005
#[ test]
@@ -1022,7 +1022,7 @@ mod tests {
1022
1022
let mut b = bitv:: Bitv :: with_capacity ( 2 , false ) ;
1023
1023
b. set ( 0 , true ) ;
1024
1024
b. set ( 1 , false ) ;
1025
- assert_eq ! ( b. to_str ( ) . as_slice( ) , "10" ) ;
1025
+ assert_eq ! ( b. to_string ( ) . as_slice( ) , "10" ) ;
1026
1026
}
1027
1027
1028
1028
#[ test]
@@ -1333,7 +1333,7 @@ mod tests {
1333
1333
fn test_from_bytes ( ) {
1334
1334
let bitv = from_bytes ( [ 0b10110110 , 0b00000000 , 0b11111111 ] ) ;
1335
1335
let str = format ! ( "{}{}{}" , "10110110" , "00000000" , "11111111" ) ;
1336
- assert_eq ! ( bitv. to_str ( ) . as_slice( ) , str . as_slice( ) ) ;
1336
+ assert_eq ! ( bitv. to_string ( ) . as_slice( ) , str . as_slice( ) ) ;
1337
1337
}
1338
1338
1339
1339
#[ test]
@@ -1352,7 +1352,7 @@ mod tests {
1352
1352
fn test_from_bools ( ) {
1353
1353
let bools = vec ! [ true , false , true , true ] ;
1354
1354
let bitv: Bitv = bools. iter ( ) . map ( |n| * n) . collect ( ) ;
1355
- assert_eq ! ( bitv. to_str ( ) . as_slice( ) , "1011" ) ;
1355
+ assert_eq ! ( bitv. to_string ( ) . as_slice( ) , "1011" ) ;
1356
1356
}
1357
1357
1358
1358
#[ test]
@@ -1787,7 +1787,7 @@ mod tests {
1787
1787
s. insert ( 10 ) ;
1788
1788
s. insert ( 50 ) ;
1789
1789
s. insert ( 2 ) ;
1790
- assert_eq ! ( "{1, 2, 10, 50}" . to_string( ) , s. to_str ( ) ) ;
1790
+ assert_eq ! ( "{1, 2, 10, 50}" . to_string( ) , s. to_string ( ) ) ;
1791
1791
}
1792
1792
1793
1793
fn rng ( ) -> rand:: IsaacRng {
0 commit comments