Implement From<BareJid> and From<FullJid> for Jid.

This commit is contained in:
lumi 2019-07-06 14:55:19 +02:00
parent 78b0d016f1
commit 8f0d5c7ca1

View file

@ -80,6 +80,18 @@ impl From<Jid> for String {
} }
} }
impl From<BareJid> for Jid {
fn from(bare_jid: BareJid) -> Jid {
Jid::Bare(bare_jid)
}
}
impl From<FullJid> for Jid {
fn from(full_jid: FullJid) -> Jid {
Jid::Full(full_jid)
}
}
/// A struct representing a full Jabber ID. /// A struct representing a full Jabber ID.
/// ///
/// A full Jabber ID is composed of 3 components, of which one is optional: /// A full Jabber ID is composed of 3 components, of which one is optional: