diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2013-01-15 17:30:01 -0800 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2013-02-13 11:46:25 -0800 |
| commit | 389125aeb83eb1571ff1ec4e5e140b1ac2109341 (patch) | |
| tree | e4ee3e2e634ab805c502be38534da08c28baa105 /src/libcore/num/uint-template.rs | |
| parent | d06e6e758aff5ec19f165519447e620f98b00c03 (diff) | |
| download | rust-389125aeb83eb1571ff1ec4e5e140b1ac2109341.tar.gz rust-389125aeb83eb1571ff1ec4e5e140b1ac2109341.zip | |
core: add min and max to cmp, re-export various places.
Diffstat (limited to 'src/libcore/num/uint-template.rs')
| -rw-r--r-- | src/libcore/num/uint-template.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libcore/num/uint-template.rs b/src/libcore/num/uint-template.rs index 0a219660fb9..4a3c5715201 100644 --- a/src/libcore/num/uint-template.rs +++ b/src/libcore/num/uint-template.rs @@ -27,6 +27,8 @@ use u8; use u16; use u32; +pub use cmp::{min, max}; + pub const bits : uint = inst::bits; pub const bytes : uint = (inst::bits / 8); @@ -34,11 +36,6 @@ pub const min_value: T = 0 as T; pub const max_value: T = 0 as T - 1 as T; #[inline(always)] -pub pure fn min(x: T, y: T) -> T { if x < y { x } else { y } } -#[inline(always)] -pub pure fn max(x: T, y: T) -> T { if x > y { x } else { y } } - -#[inline(always)] pub pure fn add(x: T, y: T) -> T { x + y } #[inline(always)] pub pure fn sub(x: T, y: T) -> T { x - y } |
