diff options
| author | bors <bors@rust-lang.org> | 2014-02-24 04:11:53 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-02-24 04:11:53 -0800 |
| commit | 672097753a217d4990129cbdfab16ef8c9b08b21 (patch) | |
| tree | cf206fc1ba6465032dac4fdce670860538da0140 /src/libstd/num | |
| parent | a5342d5970d57dd0cc4805ba0f5385d7f3859c94 (diff) | |
| parent | 8761f79485f11ef03eb6cb569ccb9f4c73e68f11 (diff) | |
| download | rust-672097753a217d4990129cbdfab16ef8c9b08b21.tar.gz rust-672097753a217d4990129cbdfab16ef8c9b08b21.zip | |
auto merge of #12412 : alexcrichton/rust/deriving-show, r=huonw
This commit removes deriving(ToStr) in favor of deriving(Show), migrating all impls of ToStr to fmt::Show. Most of the details can be found in the first commit message. Closes #12477
Diffstat (limited to 'src/libstd/num')
| -rw-r--r-- | src/libstd/num/f32.rs | 6 | ||||
| -rw-r--r-- | src/libstd/num/f64.rs | 6 | ||||
| -rw-r--r-- | src/libstd/num/int_macros.rs | 8 | ||||
| -rw-r--r-- | src/libstd/num/uint_macros.rs | 8 |
4 files changed, 0 insertions, 28 deletions
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 7b1fe949199..a4eac564ee6 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -19,7 +19,6 @@ use libc::{c_float, c_int}; use num::{FPCategory, FPNaN, FPInfinite , FPZero, FPSubnormal, FPNormal}; use num::{Zero, One, Bounded, strconv}; use num; -use to_str; use intrinsics; macro_rules! delegate( @@ -745,11 +744,6 @@ pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> ~str { r } -impl to_str::ToStr for f32 { - #[inline] - fn to_str(&self) -> ~str { to_str_digits(*self, 8) } -} - impl num::ToStrRadix for f32 { /// Converts a float to a string in a given radix /// diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index d5a571cdd23..e6b903cbbdb 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -20,7 +20,6 @@ use libc::{c_double, c_int}; use num::{FPCategory, FPNaN, FPInfinite , FPZero, FPSubnormal, FPNormal}; use num::{Zero, One, Bounded, strconv}; use num; -use to_str; use intrinsics; pub use cmp::{min, max}; @@ -747,11 +746,6 @@ pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> ~str { r } -impl to_str::ToStr for f64 { - #[inline] - fn to_str(&self) -> ~str { to_str_digits(*self, 8) } -} - impl num::ToStrRadix for f64 { /// Converts a float to a string in a given radix /// diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs index 43a70190812..030aa2d81fa 100644 --- a/src/libstd/num/int_macros.rs +++ b/src/libstd/num/int_macros.rs @@ -273,14 +273,6 @@ pub fn to_str_bytes<U>(n: $T, radix: uint, f: |v: &[u8]| -> U) -> U { f(buf.slice(0, cur)) } -impl ToStr for $T { - /// Convert to a string in base 10. - #[inline] - fn to_str(&self) -> ~str { - format!("{:d}", *self) - } -} - impl ToStrRadix for $T { /// Convert to a string in a given base. #[inline] diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index d60b5235446..001927e6033 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -187,14 +187,6 @@ pub fn to_str_bytes<U>(n: $T, radix: uint, f: |v: &[u8]| -> U) -> U { f(buf.slice(0, cur)) } -impl ToStr for $T { - /// Convert to a string in base 10. - #[inline] - fn to_str(&self) -> ~str { - format!("{:u}", *self) - } -} - impl ToStrRadix for $T { /// Convert to a string in a given base. #[inline] |
