From 845465ee246bee760b8ef0da725f8a711bfc23c9 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 15 Jun 2013 19:24:20 -0400 Subject: [PATCH] old_iter: rm the min/max free functions --- src/libstd/old_iter.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/libstd/old_iter.rs b/src/libstd/old_iter.rs index 39f3a81ad218..347b47744228 100644 --- a/src/libstd/old_iter.rs +++ b/src/libstd/old_iter.rs @@ -187,40 +187,6 @@ pub fn position>(this: &IA, f: &fn(&A) -> bool) return None; } -// note: 'rposition' would only make sense to provide with a bidirectional -// iter interface, such as would provide "reach" in addition to "each". As is, -// it would have to be implemented with foldr, which is too inefficient. - -#[inline(always)] -pub fn min>(this: &IA) -> A { - match do foldl::,IA>(this, None) |a, b| { - match a { - &Some(ref a_) if *a_ < *b => { - *(a) - } - _ => Some(*b) - } - } { - Some(val) => val, - None => fail!("min called on empty iterator") - } -} - -#[inline(always)] -pub fn max>(this: &IA) -> A { - match do foldl::,IA>(this, None) |a, b| { - match a { - &Some(ref a_) if *a_ > *b => { - *(a) - } - _ => Some(*b) - } - } { - Some(val) => val, - None => fail!("max called on empty iterator") - } -} - #[inline(always)] pub fn find>(this: &IA, f: &fn(&A) -> bool) -> Option {