From a1e101b513e1151a56a9cfa301228e4c7d13df63 Mon Sep 17 00:00:00 2001 From: Hugo Duncan Date: Thu, 30 Apr 2015 16:50:51 -0400 Subject: [PATCH] Make Value use the 'json' format string --- src/json/value.rs | 4 ++-- tests/test_json.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/json/value.rs b/src/json/value.rs index 68e58ae5..bfec0474 100644 --- a/src/json/value.rs +++ b/src/json/value.rs @@ -574,7 +574,7 @@ impl ser::Serializer for Serializer { #[inline] fn format() -> &'static str { - "value" + "json" } } @@ -685,7 +685,7 @@ impl de::Deserializer for Deserializer { #[inline] fn format() -> &'static str { - "value" + "json" } } diff --git a/tests/test_json.rs b/tests/test_json.rs index bbead941..f6ca5a47 100644 --- a/tests/test_json.rs +++ b/tests/test_json.rs @@ -1047,7 +1047,7 @@ fn test_missing_renamed_field() { fn test_missing_fmt_renamed_field() { #[derive(Debug, PartialEq, Deserialize)] struct Foo { - #[serde(rename(json="y", value="z"))] + #[serde(rename(json="y"))] x: Option, } @@ -1061,7 +1061,7 @@ fn test_missing_fmt_renamed_field() { assert_eq!(value, Foo { x: None }); let value : Foo = from_value(Value::Object(treemap!( - "z".to_string() => Value::I64(5) + "y".to_string() => Value::I64(5) ))).unwrap(); assert_eq!(value, Foo { x: Some(5) }); }