From 56b465751890f7c53b0d972210338cba6528584c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 1 Mar 2018 16:24:53 +0100 Subject: [PATCH] simplify Debug and Display implementations --- src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ebdfa80d..0f2289f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,15 +57,13 @@ impl From for String { impl fmt::Debug for Jid { fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { - write!(fmt, "JID({})", self)?; - Ok(()) + write!(fmt, "JID({})", self) } } impl fmt::Display for Jid { fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { - fmt.write_str(String::from(self.clone()).as_ref())?; - Ok(()) + fmt.write_str(String::from(self.clone()).as_ref()) } }