mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-24 23:57:57 +00:00
Remove the std_misc feature flag
This commit is contained in:
+16
-3
@@ -1,4 +1,3 @@
|
||||
use std::{f32, f64};
|
||||
use std::io;
|
||||
use std::num::{Float, FpCategory};
|
||||
use std::string::FromUtf8Error;
|
||||
@@ -396,7 +395,14 @@ fn fmt_f32_or_null<W>(wr: &mut W, value: f32) -> io::Result<()>
|
||||
{
|
||||
match value.classify() {
|
||||
FpCategory::Nan | FpCategory::Infinite => wr.write_all(b"null"),
|
||||
_ => wr.write_all(f32::to_str_digits(value, 6).as_bytes()),
|
||||
_ => {
|
||||
let s = value.to_string();
|
||||
try!(wr.write_all(s.as_bytes()));
|
||||
if !s.contains('.') {
|
||||
try!(wr.write_all(b".0"))
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +411,14 @@ fn fmt_f64_or_null<W>(wr: &mut W, value: f64) -> io::Result<()>
|
||||
{
|
||||
match value.classify() {
|
||||
FpCategory::Nan | FpCategory::Infinite => wr.write_all(b"null"),
|
||||
_ => wr.write_all(f64::to_str_digits(value, 6).as_bytes()),
|
||||
_ => {
|
||||
let s = value.to_string();
|
||||
try!(wr.write_all(s.as_bytes()));
|
||||
if !s.contains('.') {
|
||||
try!(wr.write_all(b".0"))
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
//! leaving serde to perform roughly the same speed as a hand written serializer for a specific
|
||||
//! type.
|
||||
|
||||
#![feature(collections, core, std_misc)]
|
||||
#![feature(collections, core)]
|
||||
|
||||
|
||||
pub use ser::{Serialize, Serializer};
|
||||
|
||||
+2
-5
@@ -1,4 +1,3 @@
|
||||
use std::collections::hash_state::HashState;
|
||||
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecMap};
|
||||
use std::hash::Hash;
|
||||
use std::path;
|
||||
@@ -151,9 +150,8 @@ impl<T> Serialize for BTreeSet<T>
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, H> Serialize for HashSet<T, H>
|
||||
impl<T> Serialize for HashSet<T>
|
||||
where T: Serialize + Eq + Hash,
|
||||
H: HashState,
|
||||
{
|
||||
#[inline]
|
||||
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
|
||||
@@ -400,10 +398,9 @@ impl<K, V> Serialize for BTreeMap<K, V>
|
||||
}
|
||||
}
|
||||
|
||||
impl<K, V, H> Serialize for HashMap<K, V, H>
|
||||
impl<K, V> Serialize for HashMap<K, V>
|
||||
where K: Serialize + Eq + Hash,
|
||||
V: Serialize,
|
||||
H: HashState,
|
||||
{
|
||||
#[inline]
|
||||
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
|
||||
|
||||
Reference in New Issue
Block a user