Rename FP* to FpCategory::* following std changes

This commit is contained in:
Thomas Bahn 2014-12-30 14:38:39 +01:00
parent 1366bf47e7
commit 85d0c8e4e8
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
use std::f64;
use std::io::{mod, ByRefWriter, IoError};
use std::num::{Float, FPNaN, FPInfinite};
use std::num::{Float, FpCategory};
use std::str::Utf8Error;
use ser;
@ -225,7 +225,7 @@ pub fn escape_char<W: io::Writer>(wr: &mut W, value: char) -> Result<(), IoError
fn fmt_f64_or_null<W: io::Writer>(wr: &mut W, value: f64) -> Result<(), IoError> {
match value.classify() {
FPNaN | FPInfinite => wr.write_str("null"),
FpCategory::Nan | FpCategory::Infinite => wr.write_str("null"),
_ => wr.write_str(f64::to_str_digits(value, 6).as_slice()),
}
}

View File

@ -1,6 +1,6 @@
use std::f32;
use std::f64;
use std::num::{Float, FPNaN, FPInfinite};
use std::num::{Float, FpCategory};
use std::io::{IoError, IoResult};
use std::str::Utf8Error;
@ -52,14 +52,14 @@ fn escape_char<W: Writer>(wr: &mut W, v: char) -> IoResult<()> {
fn fmt_f32_or_null<W: Writer>(wr: &mut W, v: f32) -> IoResult<()> {
match v.classify() {
FPNaN | FPInfinite => wr.write_str("null"),
FpCategory::Nan | FpCategory::Infinite => wr.write_str("null"),
_ => wr.write_str(f32::to_str_digits(v, 6).as_slice()),
}
}
fn fmt_f64_or_null<W: Writer>(wr: &mut W, v: f64) -> IoResult<()> {
match v.classify() {
FPNaN | FPInfinite => wr.write_str("null"),
FpCategory::Nan | FpCategory::Infinite => wr.write_str("null"),
_ => wr.write_str(f64::to_str_digits(v, 6).as_slice()),
}
}