Skip to content

Commit 6c0ad5b

Browse files
author
Jorge Aparicio
committed
bench: fix fallout
1 parent 91eeb64 commit 6c0ad5b

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

src/test/bench/shootout-fasta.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ impl<'a> AAGen<'a> {
7575
AAGen { rng: rng, data: data }
7676
}
7777
}
78-
impl<'a> Iterator<u8> for AAGen<'a> {
78+
impl<'a> Iterator for AAGen<'a> {
79+
type Item = u8;
80+
7981
fn next(&mut self) -> Option<u8> {
8082
let r = self.rng.gen();
8183
self.data.iter()
@@ -85,7 +87,7 @@ impl<'a> Iterator<u8> for AAGen<'a> {
8587
}
8688
}
8789

88-
fn make_fasta<W: Writer, I: Iterator<u8>>(
90+
fn make_fasta<W: Writer, I: Iterator<Item=u8>>(
8991
wr: &mut W, header: &str, mut it: I, mut n: uint)
9092
-> std::io::IoResult<()>
9193
{

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ impl Table {
194194
}
195195
}
196196

197-
impl<'a> Iterator<&'a Entry> for Items<'a> {
197+
impl<'a> Iterator for Items<'a> {
198+
type Item = &'a Entry;
199+
198200
fn next(&mut self) -> Option<&'a Entry> {
199201
let ret = match self.cur {
200202
None => {

src/test/bench/shootout-meteor.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ struct Iterate<'a, T> {
5757
f: |&T|: 'a -> T,
5858
next: T
5959
}
60-
impl<'a, T> Iterator<T> for Iterate<'a, T> {
60+
impl<'a, T> Iterator for Iterate<'a, T> {
61+
type Item = T;
62+
6163
fn next(&mut self) -> Option<T> {
6264
let mut res = (self.f)(&self.next);
6365
std::mem::swap(&mut res, &mut self.next);
@@ -78,7 +80,9 @@ impl<'a, T> List<'a, T> {
7880
ListIterator{cur: self}
7981
}
8082
}
81-
impl<'a, T> Iterator<&'a T> for ListIterator<'a, T> {
83+
impl<'a, T> Iterator for ListIterator<'a, T> {
84+
type Item = &'a T;
85+
8286
fn next(&mut self) -> Option<&'a T> {
8387
match *self.cur {
8488
List::Nil => None,

src/test/bench/shootout-reverse-complement.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ struct MutDnaSeqs<'a> { s: &'a mut [u8] }
150150
fn mut_dna_seqs<'a>(s: &'a mut [u8]) -> MutDnaSeqs<'a> {
151151
MutDnaSeqs { s: s }
152152
}
153-
impl<'a> Iterator<&'a mut [u8]> for MutDnaSeqs<'a> {
153+
impl<'a> Iterator for MutDnaSeqs<'a> {
154+
type Item = &'a mut [u8];
155+
154156
fn next(&mut self) -> Option<&'a mut [u8]> {
155157
let tmp = std::mem::replace(&mut self.s, &mut []);
156158
let tmp = match memchr(tmp, b'\n') {
@@ -229,7 +231,7 @@ unsafe impl<T: 'static> Send for Racy<T> {}
229231
/// The closure `f` is run in parallel with an element of `iter`.
230232
fn parallel<'a, I, T, F>(mut iter: I, f: F)
231233
where T: 'a+Send + Sync,
232-
I: Iterator<&'a mut [T]>,
234+
I: Iterator<Item=&'a mut [T]>,
233235
F: Fn(&mut [T]) + Sync {
234236
use std::mem;
235237
use std::raw::Repr;

0 commit comments

Comments
 (0)