rm CopyableOrderedIter

replaced with OrdIterator
This commit is contained in:
Daniel Micay 2013-06-15 03:16:10 -04:00
parent 6c547e42c8
commit e097d5eaba
5 changed files with 4 additions and 33 deletions

View File

@ -165,7 +165,7 @@ fn represent_type_uncached(cx: &mut CrateContext, t: ty::t) -> Repr {
if cases.all(|c| c.tys.len() == 0) {
// All bodies empty -> intlike
let discrs = cases.map(|c| c.discr);
return CEnum(discrs.min(), discrs.max());
return CEnum(*discrs.iter().min().unwrap(), *discrs.iter().max().unwrap());
}
if cases.len() == 1 {
@ -509,7 +509,7 @@ pub fn trans_const(ccx: &mut CrateContext, r: &Repr, discr: int,
}
General(ref cases) => {
let case = &cases[discr as uint];
let max_sz = cases.map(|s| s.size).max();
let max_sz = cases.iter().transform(|x| x.size).max().unwrap();
let discr_ty = C_int(ccx, discr);
let contents = build_const_struct(ccx, case,
~[discr_ty] + vals);

View File

@ -54,11 +54,6 @@ pub trait CopyableIter<A:Copy> {
fn find(&self, p: &fn(&A) -> bool) -> Option<A>;
}
pub trait CopyableOrderedIter<A:Copy + Ord> {
fn min(&self) -> A;
fn max(&self) -> A;
}
// A trait for sequences that can be built by imperatively pushing elements
// onto them.
pub trait Buildable<A> {

View File

@ -47,9 +47,9 @@ pub use char::Char;
pub use container::{Container, Mutable, Map, Set};
pub use hash::Hash;
pub use old_iter::{BaseIter, ReverseIter, ExtendedIter, EqIter};
pub use old_iter::{CopyableIter, CopyableOrderedIter};
pub use old_iter::CopyableIter;
pub use iter::{Times, FromIter};
pub use iterator::{Iterator, IteratorUtil};
pub use iterator::{Iterator, IteratorUtil, OrdIterator};
pub use num::{Num, NumCast};
pub use num::{Orderable, Signed, Unsigned, Round};
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};

View File

@ -2619,23 +2619,6 @@ impl<A:Copy> old_iter::CopyableIter<A> for @[A] {
}
}
impl<'self,A:Copy + Ord> old_iter::CopyableOrderedIter<A> for &'self [A] {
fn min(&self) -> A { old_iter::min(self) }
fn max(&self) -> A { old_iter::max(self) }
}
// FIXME(#4148): This should be redundant
impl<A:Copy + Ord> old_iter::CopyableOrderedIter<A> for ~[A] {
fn min(&self) -> A { old_iter::min(self) }
fn max(&self) -> A { old_iter::max(self) }
}
// FIXME(#4148): This should be redundant
impl<A:Copy + Ord> old_iter::CopyableOrderedIter<A> for @[A] {
fn min(&self) -> A { old_iter::min(self) }
fn max(&self) -> A { old_iter::max(self) }
}
impl<A:Clone> Clone for ~[A] {
#[inline]
fn clone(&self) -> ~[A] {

View File

@ -196,10 +196,3 @@ impl<A: Copy> old_iter::CopyableIter<A> for OptVec<A> {
old_iter::find(self, f)
}
}
impl<A: Copy+Ord> old_iter::CopyableOrderedIter<A> for OptVec<A> {
#[inline(always)]
fn min(&self) -> A { old_iter::min(self) }
#[inline(always)]
fn max(&self) -> A { old_iter::max(self) }
}