From 24aef813b3913cfca2166f3db7338e2bea671cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 10 Jun 2019 22:04:03 +0200 Subject: [PATCH] rustfmt pass after split-jids merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/lib.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8a243b69..fcd6f551 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,7 @@ impl FromStr for Jid { None => Jid::Bare(BareJid { node: ns, domain: ds, - }) + }), }) } } @@ -235,11 +235,7 @@ fn _from_str(s: &str) -> Result { } else if let ParserState::Resource = state { return Err(JidParseError::EmptyResource); } - Ok(( - node, - domain.ok_or(JidParseError::NoDomain)?, - resource, - )) + Ok((node, domain.ok_or(JidParseError::NoDomain)?, resource)) } impl FromStr for FullJid { @@ -280,7 +276,7 @@ impl FullJid { FullJid { node: Some(node.into()), domain: domain.into(), - resource: resource.into() + resource: resource.into(), } } @@ -554,7 +550,10 @@ mod tests { #[test] fn can_parse_full_jids() { - assert_eq!(FullJid::from_str("a@b.c/d"), Ok(FullJid::new("a", "b.c", "d"))); + assert_eq!( + FullJid::from_str("a@b.c/d"), + Ok(FullJid::new("a", "b.c", "d")) + ); assert_eq!( FullJid::from_str("b.c/d"), Ok(FullJid { @@ -606,7 +605,10 @@ mod tests { #[test] fn bare_to_full_jid() { - assert_eq!(BareJid::new("a", "b.c").with_resource("d"), FullJid::new("a", "b.c", "d")); + assert_eq!( + BareJid::new("a", "b.c").with_resource("d"), + FullJid::new("a", "b.c", "d") + ); } #[test] @@ -615,10 +617,7 @@ mod tests { String::from(FullJid::new("a", "b", "c")), String::from("a@b/c") ); - assert_eq!( - String::from(BareJid::new("a", "b")), - String::from("a@b") - ); + assert_eq!(String::from(BareJid::new("a", "b")), String::from("a@b")); } #[test]