about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthijs Hofstra <thiezz@gmail.com>2013-06-16 23:48:46 +0200
committerMatthijs Hofstra <thiezz@gmail.com>2013-06-23 23:21:35 +0200
commit6762754d5b718d2d3f938963d2a4d82eb20eb9fd (patch)
tree7f580dd0f1a780bce40008242f75db9ea2b5654a
parent66fd3c9e5dd8c9b44237b57f455ba60ef607958b (diff)
downloadrust-6762754d5b718d2d3f938963d2a4d82eb20eb9fd.tar.gz
rust-6762754d5b718d2d3f938963d2a4d82eb20eb9fd.zip
Updated shootout-fasta.rs copyright years, removed stuff that caused lint to complain.
-rw-r--r--src/test/bench/shootout-fasta.rs30
1 files 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()
     };