From fc23f987cdecd0a2a149547579ae971563f25133 Mon Sep 17 00:00:00 2001 From: mb Date: Fri, 4 Aug 2023 16:38:41 +0200 Subject: [PATCH] style: Run cargo fmt --- jid/src/lib.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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();