From ac92cc88983e360f3b1b47048b928e43242a66f1 Mon Sep 17 00:00:00 2001 From: Mahmut Bulut Date: Sun, 28 Oct 2012 22:36:01 +0200 Subject: [PATCH 1/2] Removing iter::TimesIx --- src/libcore/int-template.rs | 17 ----------------- src/libcore/uint-template.rs | 13 ------------- 2 files changed, 30 deletions(-) diff --git a/src/libcore/int-template.rs b/src/libcore/int-template.rs index 5a2b054dd3e83..a25231c88505a 100644 --- a/src/libcore/int-template.rs +++ b/src/libcore/int-template.rs @@ -98,23 +98,6 @@ impl T: iter::Times { } } -impl T: iter::TimesIx { - #[inline(always)] - /// Like `times`, but provides an index - pure fn timesi(it: fn(uint) -> bool) { - let slf = self as uint; - if slf < 0u { - fail fmt!("The .timesi method expects a nonnegative number, \ - but found %?", self); - } - let mut i = 0u; - while i < slf { - if !it(i) { break } - i += 1u; - } - } -} - /** * Parse a buffer of bytes * diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs index 3199262ae163f..bdce82f4dd330 100644 --- a/src/libcore/uint-template.rs +++ b/src/libcore/uint-template.rs @@ -88,19 +88,6 @@ impl T: iter::Times { } } -impl T: iter::TimesIx { - #[inline(always)] - /// Like `times`, but with an index, `eachi`-style. - pure fn timesi(it: fn(uint) -> bool) { - let slf = self as uint; - let mut i = 0u; - while i < slf { - if !it(i) { break } - i += 1u; - } - } -} - /** * Parse a buffer of bytes * From f938714be165cd3a783ee76608298e4f32a1edb0 Mon Sep 17 00:00:00 2001 From: Mahmut Bulut Date: Tue, 30 Oct 2012 15:19:14 +0200 Subject: [PATCH 2/2] Remove trait of TimesIx --- src/libcore/iter.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index f79a2e8f17b4b..bb28d0ef4fbac 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -34,10 +34,6 @@ pub trait Times { pure fn times(it: fn() -> bool); } -pub trait TimesIx{ - pure fn timesi(it: fn(uint) -> bool); -} - pub trait CopyableIter { pure fn filter_to_vec(pred: fn(a: A) -> bool) -> ~[A]; pure fn map_to_vec(op: fn(v: A) -> B) -> ~[B];