diff --git a/jid/src/lib.rs b/jid/src/lib.rs index 2e693e75..28b9fb8d 100644 --- a/jid/src/lib.rs +++ b/jid/src/lib.rs @@ -912,28 +912,26 @@ mod tests { assert_eq!(fulljid, FullJid::new("node@domain/resource").unwrap()); } - #[cfg(feature="serde")] + #[cfg(feature = "serde")] #[derive(Serialize, Deserialize)] struct User { jid: T, } - #[cfg(feature="serde")] + #[cfg(feature = "serde")] impl From for User { fn from(jid: T) -> User { - User { - jid, - } + User { jid } } } - #[cfg(feature="serde")] + #[cfg(feature = "serde")] const BARE_JSON_STR: &'static str = "{\"jid\":\"node@domain\"}"; - #[cfg(feature="serde")] + #[cfg(feature = "serde")] const FULL_JSON_STR: &'static str = "{\"jid\":\"node@domain/resource\"}"; #[test] - #[cfg(feature="serde")] + #[cfg(feature = "serde")] fn jid_serialize() { let jid: User = Jid::new("node@domain").unwrap().into(); assert_eq!(BARE_JSON_STR, serde_json::to_string(&jid).unwrap()); @@ -944,7 +942,7 @@ mod tests { } #[test] - #[cfg(feature="serde")] + #[cfg(feature = "serde")] fn jid_deserialize() { let jid = Jid::new("node@domain").unwrap(); let deser_jid: User = serde_json::from_str(BARE_JSON_STR).unwrap();