diff options
| author | Richo Healey <richo@psych0tik.net> | 2014-06-21 03:39:03 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-07-08 13:01:43 -0700 |
| commit | 12c334a77b897f7b1cb6cff3c56a71ecb89c82af (patch) | |
| tree | 1f5a85061a69058875391ec6171cf8b446996dff /src/test/bench | |
| parent | bfe4ddfdea45533c98657701509bb7185fd96cba (diff) | |
| download | rust-12c334a77b897f7b1cb6cff3c56a71ecb89c82af.tar.gz rust-12c334a77b897f7b1cb6cff3c56a71ecb89c82af.zip | |
std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.
[breaking-change]
Diffstat (limited to 'src/test/bench')
| -rw-r--r-- | src/test/bench/core-set.rs | 10 | ||||
| -rw-r--r-- | src/test/bench/core-uint-to-str.rs | 2 | ||||
| -rw-r--r-- | src/test/bench/shootout-chameneos-redux.rs | 2 | ||||
| -rw-r--r-- | src/test/bench/shootout-k-nucleotide-pipes.rs | 4 | ||||
| -rw-r--r-- | src/test/bench/shootout-pfib.rs | 2 | ||||
| -rw-r--r-- | src/test/bench/shootout-regex-dna.rs | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/src/test/bench/core-set.rs b/src/test/bench/core-set.rs index c3e877f8081..1d2d02d7d59 100644 --- a/src/test/bench/core-set.rs +++ b/src/test/bench/core-set.rs @@ -90,11 +90,11 @@ impl Results { let mut set = f(); timed(&mut self.sequential_strings, || { for i in range(0u, num_keys) { - set.insert(i.to_str()); + set.insert(i.to_string()); } for i in range(0u, num_keys) { - assert!(set.contains(&i.to_str())); + assert!(set.contains(&i.to_string())); } }) } @@ -103,7 +103,7 @@ impl Results { let mut set = f(); timed(&mut self.random_strings, || { for _ in range(0, num_keys) { - let s = rng.gen::<uint>().to_str(); + let s = rng.gen::<uint>().to_string(); set.insert(s); } }) @@ -112,11 +112,11 @@ impl Results { { let mut set = f(); for i in range(0u, num_keys) { - set.insert(i.to_str()); + set.insert(i.to_string()); } timed(&mut self.delete_strings, || { for i in range(0u, num_keys) { - assert!(set.remove(&i.to_str())); + assert!(set.remove(&i.to_string())); } }) } diff --git a/src/test/bench/core-uint-to-str.rs b/src/test/bench/core-uint-to-str.rs index 1c51ea055d0..f3851751566 100644 --- a/src/test/bench/core-uint-to-str.rs +++ b/src/test/bench/core-uint-to-str.rs @@ -24,7 +24,7 @@ fn main() { let n = from_str::<uint>(args.get(1).as_slice()).unwrap(); for i in range(0u, n) { - let x = i.to_str(); + let x = i.to_string(); println!("{}", x); } } diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 8095037662b..0c76d14852e 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -48,7 +48,7 @@ fn show_color_list(set: Vec<Color>) -> String { let mut out = String::new(); for col in set.iter() { out.push_char(' '); - out.push_str(col.to_str().as_slice()); + out.push_str(col.to_string().as_slice()); } out } diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 195c146c12f..b3deb88543e 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -64,7 +64,7 @@ fn sort_and_fmt(mm: &HashMap<Vec<u8> , uint>, total: uint) -> String { k.as_slice() .to_ascii() .to_upper() - .into_str(), v).as_slice()); + .into_string(), v).as_slice()); } return buffer @@ -72,7 +72,7 @@ fn sort_and_fmt(mm: &HashMap<Vec<u8> , uint>, total: uint) -> String { // given a map, search for the frequency of a pattern fn find(mm: &HashMap<Vec<u8> , uint>, key: String) -> uint { - let key = key.to_owned().into_ascii().as_slice().to_lower().into_str(); + let key = key.to_owned().into_ascii().as_slice().to_lower().into_string(); match mm.find_equiv(&key.as_bytes()) { option::None => { return 0u; } option::Some(&num) => { return num; } diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs index 85f035b60cb..0e0b0b518d5 100644 --- a/src/test/bench/shootout-pfib.rs +++ b/src/test/bench/shootout-pfib.rs @@ -115,7 +115,7 @@ fn main() { let elapsed = stop - start; - println!("{}\t{}\t{}", n, fibn, elapsed.to_str()); + println!("{}\t{}\t{}", n, fibn, elapsed.to_string()); } } } diff --git a/src/test/bench/shootout-regex-dna.rs b/src/test/bench/shootout-regex-dna.rs index 19b9d5638d0..bdf6862d0b1 100644 --- a/src/test/bench/shootout-regex-dna.rs +++ b/src/test/bench/shootout-regex-dna.rs @@ -67,7 +67,7 @@ fn main() { } else { box io::stdin() as Box<io::Reader> }; - let mut seq = rdr.read_to_str().unwrap(); + let mut seq = rdr.read_to_string().unwrap(); let ilen = seq.len(); seq = regex!(">[^\n]*\n|\n").replace_all(seq.as_slice(), NoExpand("")); @@ -109,7 +109,7 @@ fn main() { let (mut variant_strs, mut counts) = (vec!(), vec!()); for variant in variants.move_iter() { let seq_arc_copy = seq_arc.clone(); - variant_strs.push(variant.to_str().to_owned()); + variant_strs.push(variant.to_string().to_owned()); counts.push(Future::spawn(proc() { count_matches(seq_arc_copy.as_slice(), &variant) })); |
