use std::cast;
use std::cell::{Cell, RefCell};
use std::mem;
+use std::cmp;
use std::num;
use std::kinds::marker;
use std::rc::Rc;
// Functions for the POD part of the arena
fn alloc_pod_grow(&mut self, n_bytes: uint, align: uint) -> *u8 {
// Allocate a new chunk.
- let new_min_chunk_size = num::max(n_bytes, self.chunk_size());
+ let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
self.chunks.set(@Cons(self.pod_head.clone(), self.chunks.get()));
self.pod_head =
chunk(num::next_power_of_two(new_min_chunk_size + 1u), true);
fn alloc_nonpod_grow(&mut self, n_bytes: uint, align: uint)
-> (*u8, *u8) {
// Allocate a new chunk.
- let new_min_chunk_size = num::max(n_bytes, self.chunk_size());
+ let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
self.chunks.set(@Cons(self.head.clone(), self.chunks.get()));
self.head =
chunk(num::next_power_of_two(new_min_chunk_size + 1u), false);
use std::cmp;
use std::iter::RandomAccessIterator;
use std::iter::{Rev, Enumerate, Repeat, Map, Zip};
-use std::num;
use std::ops;
use std::uint;
use std::vec;
}
let nbits = self.capacity();
if value >= nbits {
- let newsize = num::max(value, nbits * 2) / uint::BITS + 1;
+ let newsize = cmp::max(value, nbits * 2) / uint::BITS + 1;
assert!(newsize > self.bitv.storage.len());
self.bitv.storage.grow(newsize, &0);
}
fn commons<'a>(&'a self, other: &'a BitvSet)
-> Map<'static, ((uint, &'a uint), &'a ~[uint]), (uint, uint, uint),
Zip<Enumerate<vec::Items<'a, uint>>, Repeat<&'a ~[uint]>>> {
- let min = num::min(self.bitv.storage.len(), other.bitv.storage.len());
+ let min = cmp::min(self.bitv.storage.len(), other.bitv.storage.len());
self.bitv.storage.slice(0, min).iter().enumerate()
.zip(Repeat::new(&other.bitv.storage))
.map(|((i, &w), o_store)| (i * uint::BITS, w, o_store[i]))
//! RingBuf implements the trait Deque. It should be imported with `use
//! extra::container::Deque`.
-use std::num;
+use std::cmp;
use std::vec;
use std::iter::{Rev, RandomAccessIterator};
/// Create an empty RingBuf with space for at least `n` elements.
pub fn with_capacity(n: uint) -> RingBuf<T> {
RingBuf{nelts: 0, lo: 0,
- elts: vec::from_fn(num::max(MINIMUM_CAPACITY, n), |_| None)}
+ elts: vec::from_fn(cmp::max(MINIMUM_CAPACITY, n), |_| None)}
}
/// Retrieve an element in the RingBuf by index
use collections::TreeMap;
use std::clone::Clone;
+use std::cmp;
use std::io;
use std::io::File;
use std::io::Writer;
if delta.abs() <= noise {
LikelyNoise
} else {
- let pct = delta.abs() / (vold.value).max(&f64::EPSILON) * 100.0;
+ let pct = delta.abs() / cmp::max(vold.value, f64::EPSILON) * 100.0;
if vold.noise < 0.0 {
// When 'noise' is negative, it means we want
// to see deltas that go up over time, and can
if self.iterations == 0 {
0
} else {
- self.ns_elapsed() / self.iterations.max(&1)
+ self.ns_elapsed() / cmp::max(self.iterations, 1)
}
}
if self.ns_per_iter() == 0 {
n = 1_000_000;
} else {
- n = 1_000_000 / self.ns_per_iter().max(&1);
+ n = 1_000_000 / cmp::max(self.ns_per_iter(), 1);
}
// if the first run took more than 1ms we don't want to just
// be left doing 0 iterations on every loop. The unfortunate
}
pub mod bench {
+ use std::cmp;
use test::{BenchHarness, BenchSamples};
pub fn benchmark(f: |&mut BenchHarness|) -> BenchSamples {
let ns_iter_summ = bs.auto_bench(f);
- let ns_iter = (ns_iter_summ.median as u64).max(&1);
+ let ns_iter = cmp::max(ns_iter_summ.median as u64, 1);
let iter_s = 1_000_000_000 / ns_iter;
let mb_s = (bs.bytes * iter_s) / 1_000_000;
#[license = "MIT/ASL2"];
use std::cell::Cell;
-use std::{os, path};
+use std::{cmp, os, path};
use std::io::fs;
use std::path::is_sep;
}
let root_len = pat_root.map_or(0u, |p| p.as_vec().len());
- let dir_patterns = pattern.slice_from(root_len.min(&pattern.len()))
+ let dir_patterns = pattern.slice_from(cmp::min(root_len, pattern.len()))
.split_terminator(is_sep).map(|s| Pattern::new(s)).to_owned_vec();
let todo = list_dir_sorted(&root).move_iter().map(|x|(x,0u)).to_owned_vec();
A `BigInt` is a combination of `BigUint` and `Sign`.
*/
+use std::cmp;
use std::cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
-use std::num;
-use std::num::{Zero, One, ToStrRadix, FromStrRadix, Orderable};
+use std::num::{Zero, One, ToStrRadix, FromStrRadix};
use std::num::{Bitwise, ToPrimitive, FromPrimitive};
use std::rand::Rng;
use std::str;
impl Num for BigUint {}
-impl Orderable for BigUint {
- #[inline]
- fn min(&self, other: &BigUint) -> BigUint {
- if self < other { self.clone() } else { other.clone() }
- }
-
- #[inline]
- fn max(&self, other: &BigUint) -> BigUint {
- if self > other { self.clone() } else { other.clone() }
- }
-
- #[inline]
- fn clamp(&self, mn: &BigUint, mx: &BigUint) -> BigUint {
- if self > mx { mx.clone() } else
- if self < mn { mn.clone() } else { self.clone() }
- }
-}
-
impl BitAnd<BigUint, BigUint> for BigUint {
fn bitand(&self, other: &BigUint) -> BigUint {
- let new_len = num::min(self.data.len(), other.data.len());
+ let new_len = cmp::min(self.data.len(), other.data.len());
let anded = vec::from_fn(new_len, |i| {
// i will never be less than the size of either data vector
let ai = self.data[i];
impl BitOr<BigUint, BigUint> for BigUint {
fn bitor(&self, other: &BigUint) -> BigUint {
- let new_len = num::max(self.data.len(), other.data.len());
+ let new_len = cmp::max(self.data.len(), other.data.len());
let ored = vec::from_fn(new_len, |i| {
let ai = if i < self.data.len() { self.data[i] } else { 0 };
let bi = if i < other.data.len() { other.data[i] } else { 0 };
impl BitXor<BigUint, BigUint> for BigUint {
fn bitxor(&self, other: &BigUint) -> BigUint {
- let new_len = num::max(self.data.len(), other.data.len());
+ let new_len = cmp::max(self.data.len(), other.data.len());
let xored = vec::from_fn(new_len, |i| {
let ai = if i < self.data.len() { self.data[i] } else { 0 };
let bi = if i < other.data.len() { other.data[i] } else { 0 };
impl Add<BigUint, BigUint> for BigUint {
fn add(&self, other: &BigUint) -> BigUint {
- let new_len = num::max(self.data.len(), other.data.len());
+ let new_len = cmp::max(self.data.len(), other.data.len());
let mut carry = 0;
let mut sum = vec::from_fn(new_len, |i| {
impl Sub<BigUint, BigUint> for BigUint {
fn sub(&self, other: &BigUint) -> BigUint {
- let new_len = num::max(self.data.len(), other.data.len());
+ let new_len = cmp::max(self.data.len(), other.data.len());
let mut borrow = 0;
let diff = vec::from_fn(new_len, |i| {
// = a1*b1 * base^2 +
// (a1*b1 + a0*b0 - (a1-b0)*(b1-a0)) * base +
// a0*b0
- let half_len = num::max(s_len, o_len) / 2;
+ let half_len = cmp::max(s_len, o_len) / 2;
let (sHi, sLo) = cut_at(self, half_len);
let (oHi, oLo) = cut_at(other, half_len);
#[inline]
fn cut_at(a: &BigUint, n: uint) -> (BigUint, BigUint) {
- let mid = num::min(a.data.len(), n);
+ let mid = cmp::min(a.data.len(), n);
return (BigUint::from_slice(a.data.slice(mid, a.data.len())),
BigUint::from_slice(a.data.slice(0, mid)));
}
let mut n: BigUint = Zero::zero();
let mut power: BigUint = One::one();
loop {
- let start = num::max(end, unit_len) - unit_len;
+ let start = cmp::max(end, unit_len) - unit_len;
match uint::parse_bytes(buf.slice(start, end), radix) {
Some(d) => {
let d: Option<BigUint> = FromPrimitive::from_uint(d);
impl Num for BigInt {}
-impl Orderable for BigInt {
- #[inline]
- fn min(&self, other: &BigInt) -> BigInt {
- if self < other { self.clone() } else { other.clone() }
- }
-
- #[inline]
- fn max(&self, other: &BigInt) -> BigInt {
- if self > other { self.clone() } else { other.clone() }
- }
-
- #[inline]
- fn clamp(&self, mn: &BigInt, mx: &BigInt) -> BigInt {
- if self > mx { mx.clone() } else
- if self < mn { mn.clone() } else { self.clone() }
- }
-}
-
impl Shl<uint, BigInt> for BigInt {
#[inline]
fn shl(&self, rhs: &uint) -> BigInt {
cmp_impl!(impl Ord, lt, gt, le, ge)
cmp_impl!(impl TotalOrd, cmp -> cmp::Ordering)
-impl<T: Clone + Integer + Ord> Orderable for Ratio<T> {
- #[inline]
- fn min(&self, other: &Ratio<T>) -> Ratio<T> {
- if *self < *other { self.clone() } else { other.clone() }
- }
-
- #[inline]
- fn max(&self, other: &Ratio<T>) -> Ratio<T> {
- if *self > *other { self.clone() } else { other.clone() }
- }
-
- #[inline]
- fn clamp(&self, mn: &Ratio<T>, mx: &Ratio<T>) -> Ratio<T> {
- if *self > *mx { mx.clone()} else
- if *self < *mn { mn.clone() } else { self.clone() }
- }
-}
-
-
/* Arithmetic */
// a/b * c/d = (a*c)/(b*d)
impl<T: Clone + Integer + Ord>
use d = driver::driver;
+use std::cmp;
use std::io;
-use std::num;
use std::os;
use std::str;
use std::task;
let mut max_key = 0;
for &(_, name) in lint_dict.iter() {
- max_key = num::max(name.len(), max_key);
+ max_key = cmp::max(name.len(), max_key);
}
fn padded(max: uint, s: &str) -> ~str {
" ".repeat(max - s.len()) + s
use std::c_str::ToCStr;
use std::cast;
+use std::cmp;
use std::io;
-use std::num;
use std::option;
use std::os::consts::{macos, freebsd, linux, android, win32};
use std::str;
let vlen = encoder::metadata_encoding_version.len();
debug!("checking {} bytes of metadata-version stamp",
vlen);
- let minsz = num::min(vlen, csz);
+ let minsz = cmp::min(vlen, csz);
let mut version_ok = false;
vec::raw::buf_as_slice(cvbuf, minsz, |buf0| {
version_ok = (buf0 ==
use middle::moves;
use util::ppaux::ty_to_str;
+use std::cmp;
use std::iter;
-use std::num;
use std::vec;
use syntax::ast::*;
use syntax::ast_util::{unguarded_pat, walk_pat};
let max_len = m.rev_iter().fold(0, |max_len, r| {
match r[0].node {
PatVec(ref before, _, ref after) => {
- num::max(before.len() + after.len(), max_len)
+ cmp::max(before.len() + after.len(), max_len)
}
_ => max_len
}
use middle::trans::type_::Type;
-use std::num;
+use std::cmp;
use std::option::{None, Some};
fn align_up_to(off: uint, a: uint) -> uint {
1
} else {
let str_tys = ty.field_types();
- str_tys.iter().fold(1, |a, t| num::max(a, ty_align(*t)))
+ str_tys.iter().fold(1, |a, t| cmp::max(a, ty_align(*t)))
}
}
Array => {
#[allow(non_uppercase_pattern_statics)];
use std::libc::c_uint;
-use std::num;
+use std::cmp;
use lib::llvm::{llvm, Integer, Pointer, Float, Double, Struct, Array};
use lib::llvm::StructRetAttribute;
use middle::trans::context::CrateContext;
1
} else {
let str_tys = ty.field_types();
- str_tys.iter().fold(1, |a, t| num::max(a, ty_align(*t)))
+ str_tys.iter().fold(1, |a, t| cmp::max(a, ty_align(*t)))
}
}
Array => {
let size = ty_size(ty) * 8;
let mut align = ty_align(ty);
- align = num::min(num::max(align, 4), 8);
+ align = cmp::min(cmp::max(align, 4), 8);
*offset = align_up_to(*offset, align);
*offset += align_up_to(size, align * 8) / 8;
use middle::trans::type_::Type;
-use std::num;
+use std::cmp;
use std::vec;
#[deriving(Clone, Eq)]
1
} else {
let str_tys = ty.field_types();
- str_tys.iter().fold(1, |a, t| num::max(a, ty_align(*t)))
+ str_tys.iter().fold(1, |a, t| cmp::max(a, ty_align(*t)))
}
}
Array => {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+use std::cmp;
use std::hashmap::HashSet;
use std::local_data;
-use std::num;
use std::uint;
use syntax::ast;
false
}
});
- num::min(min_indent, spaces)
+ cmp::min(min_indent, spaces)
}
});
fn gt(&self, other: &Self) -> bool { other.lt(self) }
#[inline]
fn ge(&self, other: &Self) -> bool { !self.lt(other) }
+
+ // FIXME (#12068): Add min/max/clamp default methods
}
/// The equivalence relation. Two values may be equivalent even if they are
use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
use clone::Clone;
-use cmp::{Eq, Equiv};
+use cmp::{Eq, Equiv, max};
use default::Default;
#[cfg(not(stage0))] use fmt;
use hash::Hash;
/// cause many collisions and very poor performance. Setting them
/// manually using this function can expose a DoS attack vector.
pub fn with_capacity_and_keys(k0: u64, k1: u64, capacity: uint) -> HashMap<K, V> {
- let cap = num::max(INITIAL_CAPACITY, capacity);
+ let cap = max(INITIAL_CAPACITY, capacity);
HashMap {
k0: k0, k1: k1,
resize_at: resize_at(cap),
//! Buffering wrappers for I/O traits
+use cmp;
use container::Container;
use io::{Reader, Writer, Stream, Buffer, DEFAULT_BUF_SIZE, IoResult};
use iter::ExactSize;
-use num;
use option::{Some, None};
use result::{Ok, Err};
use vec::{OwnedVector, ImmutableVector, MutableVector};
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
let nread = {
let available = if_ok!(self.fill());
- let nread = num::min(available.len(), buf.len());
+ let nread = cmp::min(available.len(), buf.len());
vec::bytes::copy_memory(buf, available.slice_to(nread));
nread
};
fn gt(&self, other: &f32) -> bool { (*self) > (*other) }
}
-impl Orderable for f32 {
- /// Returns `NAN` if either of the numbers are `NAN`.
- #[inline]
- fn min(&self, other: &f32) -> f32 {
- match () {
- _ if self.is_nan() => *self,
- _ if other.is_nan() => *other,
- _ if *self < *other => *self,
- _ => *other,
- }
- }
-
- /// Returns `NAN` if either of the numbers are `NAN`.
- #[inline]
- fn max(&self, other: &f32) -> f32 {
- match () {
- _ if self.is_nan() => *self,
- _ if other.is_nan() => *other,
- _ if *self > *other => *self,
- _ => *other,
- }
- }
-
- /// Returns the number constrained within the range `mn <= self <= mx`.
- /// If any of the numbers are `NAN` then `NAN` is returned.
- #[inline]
- fn clamp(&self, mn: &f32, mx: &f32) -> f32 {
- match () {
- _ if self.is_nan() => *self,
- _ if !(*self <= *mx) => *mx,
- _ if !(*self >= *mn) => *mn,
- _ => *self,
- }
- }
-}
-
impl Default for f32 {
#[inline]
fn default() -> f32 { 0.0 }
num::test_num(10f32, 2f32);
}
- #[test]
- fn test_min() {
- assert_eq!(1f32.min(&2f32), 1f32);
- assert_eq!(2f32.min(&1f32), 1f32);
- }
-
- #[test]
- fn test_max() {
- assert_eq!(1f32.max(&2f32), 2f32);
- assert_eq!(2f32.max(&1f32), 2f32);
- }
-
- #[test]
- fn test_clamp() {
- assert_eq!(1f32.clamp(&2f32, &4f32), 2f32);
- assert_eq!(8f32.clamp(&2f32, &4f32), 4f32);
- assert_eq!(3f32.clamp(&2f32, &4f32), 3f32);
-
- let nan: f32 = Float::nan();
- assert!(3f32.clamp(&nan, &4f32).is_nan());
- assert!(3f32.clamp(&2f32, &nan).is_nan());
- assert!(nan.clamp(&2f32, &4f32).is_nan());
- }
-
#[test]
fn test_floor() {
assert_approx_eq!(1.0f32.floor(), 1.0f32);
fn gt(&self, other: &f64) -> bool { (*self) > (*other) }
}
-impl Orderable for f64 {
- /// Returns `NAN` if either of the numbers are `NAN`.
- #[inline]
- fn min(&self, other: &f64) -> f64 {
- match () {
- _ if self.is_nan() => *self,
- _ if other.is_nan() => *other,
- _ if *self < *other => *self,
- _ => *other,
- }
- }
-
- /// Returns `NAN` if either of the numbers are `NAN`.
- #[inline]
- fn max(&self, other: &f64) -> f64 {
- match () {
- _ if self.is_nan() => *self,
- _ if other.is_nan() => *other,
- _ if *self > *other => *self,
- _ => *other,
- }
- }
-
- /// Returns the number constrained within the range `mn <= self <= mx`.
- /// If any of the numbers are `NAN` then `NAN` is returned.
- #[inline]
- fn clamp(&self, mn: &f64, mx: &f64) -> f64 {
- match () {
- _ if self.is_nan() => *self,
- _ if !(*self <= *mx) => *mx,
- _ if !(*self >= *mn) => *mn,
- _ => *self,
- }
- }
-}
-
impl Default for f64 {
#[inline]
fn default() -> f64 { 0.0 }
num::test_num(10f64, 2f64);
}
- #[test]
- fn test_min() {
- assert_eq!(1f64.min(&2f64), 1f64);
- assert_eq!(2f64.min(&1f64), 1f64);
-
- let nan: f64 = Float::nan();
- assert!(1f64.min(&nan).is_nan());
- assert!(nan.min(&1f64).is_nan());
- }
-
- #[test]
- fn test_max() {
- assert_eq!(1f64.max(&2f64), 2f64);
- assert_eq!(2f64.max(&1f64), 2f64);
-
- let nan: f64 = Float::nan();
- assert!(1f64.max(&nan).is_nan());
- assert!(nan.max(&1f64).is_nan());
- }
-
- #[test]
- fn test_clamp() {
- assert_eq!(1f64.clamp(&2f64, &4f64), 2f64);
- assert_eq!(8f64.clamp(&2f64, &4f64), 4f64);
- assert_eq!(3f64.clamp(&2f64, &4f64), 3f64);
-
- let nan: f64 = Float::nan();
- assert!(3f64.clamp(&nan, &4f64).is_nan());
- assert!(3f64.clamp(&2f64, &nan).is_nan());
- assert!(nan.clamp(&2f64, &4f64).is_nan());
- }
-
#[test]
fn test_floor() {
assert_approx_eq!(1.0f64.floor(), 1.0f64);
fn eq(&self, other: &$T) -> bool { return (*self) == (*other); }
}
-impl Orderable for $T {
- #[inline]
- fn min(&self, other: &$T) -> $T {
- if *self < *other { *self } else { *other }
- }
-
- #[inline]
- fn max(&self, other: &$T) -> $T {
- if *self > *other { *self } else { *other }
- }
-
- #[inline]
- fn clamp(&self, mn: &$T, mx: &$T) -> $T {
- if *self > *mx { *mx } else
- if *self < *mn { *mn } else { *self }
- }
-}
-
impl Default for $T {
#[inline]
fn default() -> $T { 0 }
num::test_num(10 as $T, 2 as $T);
}
- #[test]
- fn test_orderable() {
- assert_eq!((1 as $T).min(&(2 as $T)), 1 as $T);
- assert_eq!((2 as $T).min(&(1 as $T)), 1 as $T);
- assert_eq!((1 as $T).max(&(2 as $T)), 2 as $T);
- assert_eq!((2 as $T).max(&(1 as $T)), 2 as $T);
- assert_eq!((1 as $T).clamp(&(2 as $T), &(4 as $T)), 2 as $T);
- assert_eq!((8 as $T).clamp(&(2 as $T), &(4 as $T)), 4 as $T);
- assert_eq!((3 as $T).clamp(&(2 as $T), &(4 as $T)), 3 as $T);
- }
-
#[test]
pub fn test_abs() {
assert_eq!((1 as $T).abs(), 1 as $T);
+ Div<Self,Self>
+ Rem<Self,Self> {}
-pub trait Orderable: Ord {
- // These should be methods on `Ord`, with overridable default implementations. We don't want
- // to encumber all implementors of Ord by requiring them to implement these functions, but at
- // the same time we want to be able to take advantage of the speed of the specific numeric
- // functions (like the `fmin` and `fmax` intrinsics).
- fn min(&self, other: &Self) -> Self;
- fn max(&self, other: &Self) -> Self;
- fn clamp(&self, mn: &Self, mx: &Self) -> Self;
-}
-
-/// Return the smaller number.
-#[inline(always)] pub fn min<T: Orderable>(x: T, y: T) -> T { x.min(&y) }
-/// Return the larger number.
-#[inline(always)] pub fn max<T: Orderable>(x: T, y: T) -> T { x.max(&y) }
-/// Returns the number constrained within the range `mn <= self <= mx`.
-#[inline(always)] pub fn clamp<T: Orderable>(value: T, mn: T, mx: T) -> T { value.clamp(&mn, &mx) }
-
/// Defines an additive identity element for `Self`.
///
/// # Deriving
pub trait Unsigned: Num {}
pub trait Integer: Num
- + Orderable
+ + Ord
+ Div<Self,Self>
+ Rem<Self,Self> {
fn div_rem(&self, other: &Self) -> (Self,Self);
/// Defines constants and methods common to real numbers
pub trait Real: Signed
- + Orderable
+ + Ord
+ Round
+ Div<Self,Self> {
// Common Constants
+ DeepClone
+ Num
+ NumCast
- + Orderable
+ + Ord
+ Bounded {}
/// A collection of traits relevant to primitive signed and unsigned integers
fn eq(&self, other: &$T) -> bool { return (*self) == (*other); }
}
-impl Orderable for $T {
- #[inline]
- fn min(&self, other: &$T) -> $T {
- if *self < *other { *self } else { *other }
- }
-
- #[inline]
- fn max(&self, other: &$T) -> $T {
- if *self > *other { *self } else { *other }
- }
-
- /// Returns the number constrained within the range `mn <= self <= mx`.
- #[inline]
- fn clamp(&self, mn: &$T, mx: &$T) -> $T {
- match () {
- _ if (*self > *mx) => *mx,
- _ if (*self < *mn) => *mn,
- _ => *self,
- }
- }
-}
-
impl Default for $T {
#[inline]
fn default() -> $T { 0 }
num::test_num(10 as $T, 2 as $T);
}
- #[test]
- fn test_orderable() {
- assert_eq!((1 as $T).min(&(2 as $T)), 1 as $T);
- assert_eq!((2 as $T).min(&(1 as $T)), 1 as $T);
- assert_eq!((1 as $T).max(&(2 as $T)), 2 as $T);
- assert_eq!((2 as $T).max(&(1 as $T)), 2 as $T);
- assert_eq!((1 as $T).clamp(&(2 as $T), &(4 as $T)), 2 as $T);
- assert_eq!((8 as $T).clamp(&(2 as $T), &(4 as $T)), 4 as $T);
- assert_eq!((3 as $T).clamp(&(2 as $T), &(4 as $T)), 3 as $T);
- }
-
#[test]
fn test_div_mod_floor() {
assert_eq!((10 as $T).div_floor(&(3 as $T)), 3 as $T);
pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, CloneableIterator};
pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
pub use num::{Integer, Real, Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};
-pub use num::{Orderable, Signed, Unsigned, Round};
+pub use num::{Signed, Unsigned, Round};
pub use num::{Primitive, Int, Float, ToStrRadix, ToPrimitive, FromPrimitive};
pub use path::{GenericPath, Path, PosixPath, WindowsPath};
pub use ptr::RawPtr;
use visit;
use std::cell::{Cell, RefCell};
+use std::cmp;
use std::hashmap::HashMap;
use std::u32;
use std::local_data;
-use std::num;
pub fn path_name_i(idents: &[Ident]) -> ~str {
// FIXME: Bad copies (#2543 -- same for everything else that says "bad")
}
pub fn add(&mut self, id: NodeId) {
- self.min = num::min(self.min, id);
- self.max = num::max(self.max, id + 1);
+ self.min = cmp::min(self.min, id);
+ self.max = cmp::max(self.max, id + 1);
}
}
use std::io;
use std::io::{BufferedWriter, File};
-use std::num::min;
+use std::cmp::min;
use std::os;
static LINE_LENGTH: uint = 60;
use std::from_str::FromStr;
use std::iter::count;
-use std::num::min;
+use std::cmp::min;
use std::os;
use std::vec::from_elem;
use sync::Arc;