mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
jid: impl &{Bare,Full}Jid for String
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
36aaa3e681
commit
91c8045329
1 changed files with 12 additions and 0 deletions
|
@ -190,6 +190,12 @@ pub struct BareJid {
|
|||
|
||||
impl From<FullJid> for String {
|
||||
fn from(jid: FullJid) -> String {
|
||||
String::from(&jid)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&FullJid> for String {
|
||||
fn from(jid: &FullJid) -> String {
|
||||
let mut string = String::new();
|
||||
if let Some(ref node) = jid.node {
|
||||
string.push_str(node);
|
||||
|
@ -204,6 +210,12 @@ impl From<FullJid> for String {
|
|||
|
||||
impl From<BareJid> for String {
|
||||
fn from(jid: BareJid) -> String {
|
||||
String::from(&jid)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&BareJid> for String {
|
||||
fn from(jid: &BareJid) -> String {
|
||||
let mut string = String::new();
|
||||
if let Some(ref node) = jid.node {
|
||||
string.push_str(node);
|
||||
|
|
Loading…
Reference in a new issue