Skip to content

Commit 6762754

Browse files
committed
Updated shootout-fasta.rs copyright years, removed stuff that caused lint to complain.
1 parent 66fd3c9 commit 6762754

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

src/test/bench/shootout-fasta.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -19,19 +19,15 @@ extern mod extra;
1919

2020
use std::int;
2121
use std::io;
22-
use std::option;
2322
use std::os;
2423
use std::rand::Rng;
2524
use std::rand;
2625
use std::result;
2726
use std::str;
2827
use std::uint;
29-
use std::vec;
3028

3129
static LINE_LENGTH: uint = 60u;
3230

33-
//fn LINE_LENGTH() -> uint { return 60u; }
34-
3531
struct MyRandom {
3632
last: u32
3733
}
@@ -95,17 +91,15 @@ fn make_repeat_fasta(wr: @io::Writer, id: ~str, desc: ~str, s: ~str, n: int) {
9591
wr.write_line(~">" + id + " " + desc);
9692
let mut op = str::with_capacity( LINE_LENGTH );
9793
let sl = s.len();
98-
unsafe {
99-
for uint::range(0u, n as uint) |i| {
100-
if (op.len() >= LINE_LENGTH) {
101-
wr.write_line( op );
102-
op = str::with_capacity( LINE_LENGTH );
103-
}
104-
op.push_char( s[i % sl] as char );
105-
}
106-
if op.len() > 0 {
107-
wr.write_line(op)
94+
for uint::range(0u, n as uint) |i| {
95+
if (op.len() >= LINE_LENGTH) {
96+
wr.write_line( op );
97+
op = str::with_capacity( LINE_LENGTH );
10898
}
99+
op.push_char( s[i % sl] as char );
100+
}
101+
if op.len() > 0 {
102+
wr.write_line(op)
109103
}
110104
}
111105
@@ -115,7 +109,7 @@ fn acid(ch: char, prob: u32) -> AminoAcids {
115109
116110
fn main() {
117111
let args = os::args();
118-
let args = if os::getenv(~"RUST_BENCH").is_some() {
112+
let args = if os::getenv("RUST_BENCH").is_some() {
119113
// alioth tests k-nucleotide with this data at 25,000,000
120114
~[~"", ~"5000000"]
121115
} else if args.len() <= 1u {
@@ -124,9 +118,9 @@ fn main() {
124118
args
125119
};
126120

127-
let writer = if os::getenv(~"RUST_BENCH").is_some() {
121+
let writer = if os::getenv("RUST_BENCH").is_some() {
128122
result::get(&io::file_writer(&Path("./shootout-fasta.data"),
129-
~[io::Truncate, io::Create]))
123+
[io::Truncate, io::Create]))
130124
} else {
131125
io::stdout()
132126
};

0 commit comments

Comments
 (0)