Skip to content

Commit af4a728

Browse files
committed
---
yaml --- r: 166743 b: refs/heads/master c: 12e6071 h: refs/heads/master i: 166741: fc4b819 166739: 42f07c1 166735: 05d120a v: v3
1 parent 0062cd0 commit af4a728

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: dd0baf7f01fc470fb7406b785d03e24fa116ed1c
2+
refs/heads/master: 12e60719c4cd2f1f4f8790eb0452869c5816f7dd
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 023dfb0c898d851dee6ace2f8339b73b5287136b
55
refs/heads/try: f5d619caf9f32458680fae55526b99582ca682dd

trunk/src/test/bench/shootout-k-nucleotide-pipes.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
extern crate collections;
1919

20+
use std::ascii::{AsciiExt, OwnedAsciiExt};
2021
use std::collections::HashMap;
2122
use std::mem::replace;
2223
use std::num::Float;
@@ -64,18 +65,16 @@ fn sort_and_fmt(mm: &HashMap<Vec<u8> , uint>, total: uint) -> String {
6465
let mut buffer = String::new();
6566
for &(ref k, v) in pairs_sorted.iter() {
6667
buffer.push_str(format!("{} {:0.3}\n",
67-
k.as_slice()
68-
.to_ascii()
69-
.to_uppercase()
70-
.into_string(), v).as_slice());
68+
k.to_ascii_uppercase(),
69+
v).as_slice());
7170
}
7271

7372
return buffer
7473
}
7574

7675
// given a map, search for the frequency of a pattern
7776
fn find(mm: &HashMap<Vec<u8> , uint>, key: String) -> uint {
78-
let key = key.into_ascii().as_slice().to_lowercase().into_string();
77+
let key = key.into_ascii_lowercase();
7978
match mm.get(key.as_bytes()) {
8079
option::Option::None => { return 0u; }
8180
option::Option::Some(&num) => { return num; }

trunk/src/test/bench/shootout-k-nucleotide.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
#![feature(slicing_syntax)]
4444

45+
use std::ascii::OwnedAsciiExt;
4546
use std::string::String;
4647
use std::slice;
4748
use std::sync::{Arc, Future};
@@ -286,10 +287,7 @@ fn get_sequence<R: Buffer>(r: &mut R, key: &str) -> Vec<u8> {
286287
{
287288
res.push_all(l.as_slice().trim().as_bytes());
288289
}
289-
for b in res.iter_mut() {
290-
*b = b.to_ascii().to_uppercase().to_byte();
291-
}
292-
res
290+
res.into_ascii_uppercase()
293291
}
294292

295293
fn main() {

0 commit comments

Comments
 (0)