diff --git a/jid/src/lib.rs b/jid/src/lib.rs index 28b9fb8..f28ca3b 100644 --- a/jid/src/lib.rs +++ b/jid/src/lib.rs @@ -914,14 +914,14 @@ mod tests { #[cfg(feature = "serde")] #[derive(Serialize, Deserialize)] - struct User { + struct JidContainer { jid: T, } #[cfg(feature = "serde")] - impl From for User { - fn from(jid: T) -> User { - User { jid } + impl From for JidContainer { + fn from(jid: T) -> JidContainer { + JidContainer { jid } } } @@ -933,11 +933,11 @@ mod tests { #[test] #[cfg(feature = "serde")] fn jid_serialize() { - let jid: User = Jid::new("node@domain").unwrap().into(); + let jid: JidContainer = Jid::new("node@domain").unwrap().into(); assert_eq!(BARE_JSON_STR, serde_json::to_string(&jid).unwrap()); - let jid: User = BareJid::new("node@domain").unwrap().into(); + let jid: JidContainer = BareJid::new("node@domain").unwrap().into(); assert_eq!(BARE_JSON_STR, serde_json::to_string(&jid).unwrap()); - let jid: User = FullJid::new("node@domain/resource").unwrap().into(); + let jid: JidContainer = FullJid::new("node@domain/resource").unwrap().into(); assert_eq!(FULL_JSON_STR, serde_json::to_string(&jid).unwrap()); } @@ -945,13 +945,13 @@ mod tests { #[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(); + let deser_jid: JidContainer = serde_json::from_str(BARE_JSON_STR).unwrap(); assert_eq!(jid, deser_jid.jid); let jid = BareJid::new("node@domain").unwrap(); - let deser_jid: User = serde_json::from_str(BARE_JSON_STR).unwrap(); + let deser_jid: JidContainer = serde_json::from_str(BARE_JSON_STR).unwrap(); assert_eq!(jid, deser_jid.jid); let jid = FullJid::new("node@domain/resource").unwrap(); - let deser_jid: User = serde_json::from_str(FULL_JSON_STR).unwrap(); + let deser_jid: JidContainer = serde_json::from_str(FULL_JSON_STR).unwrap(); assert_eq!(jid, deser_jid.jid); } }