mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-25 10:27:56 +00:00
Use deref coercions when possible
This commit is contained in:
+2
-2
@@ -53,14 +53,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() {
|
||||
FpCategory::Nan | FpCategory::Infinite => wr.write_str("null"),
|
||||
_ => wr.write_str(f32::to_str_digits(v, 6).as_slice()),
|
||||
_ => wr.write_str(&f32::to_str_digits(v, 6)),
|
||||
}
|
||||
}
|
||||
|
||||
fn fmt_f64_or_null<W: Writer>(wr: &mut W, v: f64) -> IoResult<()> {
|
||||
match v.classify() {
|
||||
FpCategory::Nan | FpCategory::Infinite => wr.write_str("null"),
|
||||
_ => wr.write_str(f64::to_str_digits(v, 6).as_slice()),
|
||||
_ => wr.write_str(&f64::to_str_digits(v, 6)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user