aboutsummaryrefslogtreecommitdiff
path: root/src/test/bench/shootout/fasta.rs
diff options
context:
space:
mode:
authorMarijn Haverbeke <[email protected]>2011-05-12 17:24:54 +0200
committerMarijn Haverbeke <[email protected]>2011-05-12 21:30:44 +0200
commit3816e57fd2a8ab19e4ac6d4b3ddd5b49d5973ff2 (patch)
tree508982ed2f789aedd89eebd529343d9dc88b8e01 /src/test/bench/shootout/fasta.rs
parentTransitional change to make extfmt output lowercase module name (diff)
downloadrust-3816e57fd2a8ab19e4ac6d4b3ddd5b49d5973ff2.tar.xz
rust-3816e57fd2a8ab19e4ac6d4b3ddd5b49d5973ff2.zip
Downcase std modules again, move to :: for module dereferencing
This should be a snapshot transition.
Diffstat (limited to 'src/test/bench/shootout/fasta.rs')
-rw-r--r--src/test/bench/shootout/fasta.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/test/bench/shootout/fasta.rs b/src/test/bench/shootout/fasta.rs
index 3543c298..ec962e38 100644
--- a/src/test/bench/shootout/fasta.rs
+++ b/src/test/bench/shootout/fasta.rs
@@ -7,10 +7,10 @@
* http://shootout.alioth.debian.org/
*/
use std;
-import std.Vec;
-import std.Str;
-import std.UInt;
-import std.Int;
+import std::_vec;
+import std::_str;
+import std::_uint;
+import std::_int;
fn LINE_LENGTH() -> uint {
ret 60u;
@@ -54,21 +54,21 @@ fn select_random(u32 r, vec[aminoacids] genelist) -> char {
ret v.(hi)._0;
}
}
- ret bisect(genelist, 0u, Vec.len[aminoacids](genelist) - 1u, r);
+ ret bisect(genelist, 0u, _vec::len[aminoacids](genelist) - 1u, r);
}
fn make_random_fasta(str id, str desc, vec[aminoacids] genelist, int n) {
log(">" + id + " " + desc);
- auto rng = myrandom(std.Rand.mk_rng().next());
+ auto rng = myrandom(std::rand::mk_rng().next());
let str op = "";
- for each (uint i in UInt.range(0u, n as uint)) {
- Str.push_byte(op, select_random(rng.next(100u32), genelist) as u8);
- if (Str.byte_len(op) >= LINE_LENGTH()) {
+ for each (uint i in _uint::range(0u, n as uint)) {
+ _str::push_byte(op, select_random(rng.next(100u32), genelist) as u8);
+ if (_str::byte_len(op) >= LINE_LENGTH()) {
log(op);
op = "";
}
}
- if (Str.byte_len(op) > 0u) {
+ if (_str::byte_len(op) > 0u) {
log(op);
}
}
@@ -76,16 +76,16 @@ fn make_random_fasta(str id, str desc, vec[aminoacids] genelist, int n) {
fn make_repeat_fasta(str id, str desc, str s, int n) {
log(">" + id + " " + desc);
let str op = "";
- let uint sl = Str.byte_len(s);
- for each (uint i in UInt.range(0u, n as uint)) {
+ let uint sl = _str::byte_len(s);
+ for each (uint i in _uint::range(0u, n as uint)) {
- Str.push_byte(op, s.(i % sl));
- if (Str.byte_len(op) >= LINE_LENGTH()) {
+ _str::push_byte(op, s.(i % sl));
+ if (_str::byte_len(op) >= LINE_LENGTH()) {
log(op);
op = "";
}
}
- if (Str.byte_len(op) > 0u) {
+ if (_str::byte_len(op) > 0u) {
log(op);
}
}