simplify Debug and Display implementations

This commit is contained in:
Emmanuel Gil Peyrot 2018-03-01 16:24:53 +01:00
parent 0589b85f15
commit 56b4657518

View file

@ -57,15 +57,13 @@ impl From<Jid> for String {
impl fmt::Debug for Jid { impl fmt::Debug for Jid {
fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
write!(fmt, "JID({})", self)?; write!(fmt, "JID({})", self)
Ok(())
} }
} }
impl fmt::Display for Jid { impl fmt::Display for Jid {
fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
fmt.write_str(String::from(self.clone()).as_ref())?; fmt.write_str(String::from(self.clone()).as_ref())
Ok(())
} }
} }