Fix serde-only compilation
This commit is contained in:
parent
3301c39630
commit
94023b1d89
|
@ -171,7 +171,7 @@ pub fn encode<T: ::rustc_serialize::Encodable>(t: &T) -> Value {
|
||||||
#[cfg(all(not(feature = "rustc-serialize"), feature = "serde"))]
|
#[cfg(all(not(feature = "rustc-serialize"), feature = "serde"))]
|
||||||
pub fn encode<T: ::serde::Serialize>(t: &T) -> Value {
|
pub fn encode<T: ::serde::Serialize>(t: &T) -> Value {
|
||||||
let mut e = Encoder::new();
|
let mut e = Encoder::new();
|
||||||
t.deserialize(&mut e).unwrap();
|
t.serialize(&mut e).unwrap();
|
||||||
Value::Table(e.toml)
|
Value::Table(e.toml)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue