From 8f0d5c7ca1368bae1c02b89250cd4df99daa459a Mon Sep 17 00:00:00 2001 From: lumi Date: Sat, 6 Jul 2019 14:55:19 +0200 Subject: [PATCH] Implement From and From for Jid. --- src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 29982c71..2401792b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -80,6 +80,18 @@ impl From for String { } } +impl From for Jid { + fn from(bare_jid: BareJid) -> Jid { + Jid::Bare(bare_jid) + } +} + +impl From for Jid { + fn from(full_jid: FullJid) -> Jid { + Jid::Full(full_jid) + } +} + /// A struct representing a full Jabber ID. /// /// A full Jabber ID is composed of 3 components, of which one is optional: