From 6762754d5b718d2d3f938963d2a4d82eb20eb9fd Mon Sep 17 00:00:00 2001 From: Matthijs Hofstra Date: Sun, 16 Jun 2013 23:48:46 +0200 Subject: [PATCH] Updated shootout-fasta.rs copyright years, removed stuff that caused lint to complain. --- src/test/bench/shootout-fasta.rs | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/test/bench/shootout-fasta.rs b/src/test/bench/shootout-fasta.rs index a69284611a2..f3efcc21ea9 100644 --- a/src/test/bench/shootout-fasta.rs +++ b/src/test/bench/shootout-fasta.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -19,19 +19,15 @@ extern mod extra; use std::int; use std::io; -use std::option; use std::os; use std::rand::Rng; use std::rand; use std::result; use std::str; use std::uint; -use std::vec; static LINE_LENGTH: uint = 60u; -//fn LINE_LENGTH() -> uint { return 60u; } - struct MyRandom { last: u32 } @@ -95,17 +91,15 @@ fn make_repeat_fasta(wr: @io::Writer, id: ~str, desc: ~str, s: ~str, n: int) { wr.write_line(~">" + id + " " + desc); let mut op = str::with_capacity( LINE_LENGTH ); let sl = s.len(); - unsafe { - for uint::range(0u, n as uint) |i| { - if (op.len() >= LINE_LENGTH) { - wr.write_line( op ); - op = str::with_capacity( LINE_LENGTH ); - } - op.push_char( s[i % sl] as char ); - } - if op.len() > 0 { - wr.write_line(op) + for uint::range(0u, n as uint) |i| { + if (op.len() >= LINE_LENGTH) { + wr.write_line( op ); + op = str::with_capacity( LINE_LENGTH ); } + op.push_char( s[i % sl] as char ); + } + if op.len() > 0 { + wr.write_line(op) } } @@ -115,7 +109,7 @@ fn acid(ch: char, prob: u32) -> AminoAcids { fn main() { let args = os::args(); - let args = if os::getenv(~"RUST_BENCH").is_some() { + let args = if os::getenv("RUST_BENCH").is_some() { // alioth tests k-nucleotide with this data at 25,000,000 ~[~"", ~"5000000"] } else if args.len() <= 1u { @@ -124,9 +118,9 @@ fn main() { args }; - let writer = if os::getenv(~"RUST_BENCH").is_some() { + let writer = if os::getenv("RUST_BENCH").is_some() { result::get(&io::file_writer(&Path("./shootout-fasta.data"), - ~[io::Truncate, io::Create])) + [io::Truncate, io::Create])) } else { io::stdout() };