diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-09-27 17:02:31 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-09-30 23:21:18 -0700 |
| commit | a8ba31dbf3e7d80a069bc486a35eff8357282b68 (patch) | |
| tree | 8a00829d527c443d16988b98cd7c97f1d3d4dac6 /src/libstd/num/float.rs | |
| parent | aaf6cc3a841095a95a9c74a6a2a3709dffd7a4e9 (diff) | |
| download | rust-a8ba31dbf3e7d80a069bc486a35eff8357282b68.tar.gz rust-a8ba31dbf3e7d80a069bc486a35eff8357282b68.zip | |
std: Remove usage of fmt!
Diffstat (limited to 'src/libstd/num/float.rs')
| -rw-r--r-- | src/libstd/num/float.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/num/float.rs b/src/libstd/num/float.rs index 7af47355c8c..4f676545d4f 100644 --- a/src/libstd/num/float.rs +++ b/src/libstd/num/float.rs @@ -181,7 +181,7 @@ impl num::ToStrRadix for float { fn to_str_radix(&self, radix: uint) -> ~str { let (r, special) = strconv::float_to_str_common( *self, radix, true, strconv::SignNeg, strconv::DigAll); - if special { fail!("number has a special value, \ + if special { fail2!("number has a special value, \ try to_str_radix_special() if those are expected") } r } @@ -1329,16 +1329,16 @@ mod tests { // note: NaN != NaN, hence this slightly complex test match from_str::<float>("NaN") { Some(f) => assert!(f.is_nan()), - None => fail!() + None => fail2!() } // note: -0 == 0, hence these slightly more complex tests match from_str::<float>("-0") { Some(v) if v.is_zero() => assert!(v.is_negative()), - _ => fail!() + _ => fail2!() } match from_str::<float>("0") { Some(v) if v.is_zero() => assert!(v.is_positive()), - _ => fail!() + _ => fail2!() } assert!(from_str::<float>("").is_none()); @@ -1376,16 +1376,16 @@ mod tests { // note: NaN != NaN, hence this slightly complex test match from_str_hex("NaN") { Some(f) => assert!(f.is_nan()), - None => fail!() + None => fail2!() } // note: -0 == 0, hence these slightly more complex tests match from_str_hex("-0") { Some(v) if v.is_zero() => assert!(v.is_negative()), - _ => fail!() + _ => fail2!() } match from_str_hex("0") { Some(v) if v.is_zero() => assert!(v.is_positive()), - _ => fail!() + _ => fail2!() } assert_eq!(from_str_hex("e"), Some(14.)); assert_eq!(from_str_hex("E"), Some(14.)); |
