Fix serde-only compilation

This commit is contained in:
Alex Crichton 2015-04-21 12:00:05 -07:00
parent 3301c39630
commit 94023b1d89

View file

@ -171,7 +171,7 @@ pub fn encode<T: ::rustc_serialize::Encodable>(t: &T) -> Value {
#[cfg(all(not(feature = "rustc-serialize"), feature = "serde"))]
pub fn encode<T: ::serde::Serialize>(t: &T) -> Value {
let mut e = Encoder::new();
t.deserialize(&mut e).unwrap();
t.serialize(&mut e).unwrap();
Value::Table(e.toml)
}