mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
simplify Debug and Display implementations
This commit is contained in:
parent
0589b85f15
commit
56b4657518
1 changed files with 2 additions and 4 deletions
|
@ -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(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue