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 {
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())
}
}