mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
jid: Fix the issues reported by clippy
This commit is contained in:
parent
4e914e5d3a
commit
9891cc48ac
1 changed files with 16 additions and 16 deletions
|
@ -260,11 +260,11 @@ impl From<&BareJid> for String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<BareJid> for FullJid {
|
impl From<FullJid> for BareJid {
|
||||||
fn into(self) -> BareJid {
|
fn from(full: FullJid) -> BareJid {
|
||||||
BareJid {
|
BareJid {
|
||||||
node: self.node,
|
node: full.node,
|
||||||
domain: self.domain,
|
domain: full.domain,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ fn _from_str(s: &str) -> Result<StringJid, JidParseError> {
|
||||||
ParserState::Node => {
|
ParserState::Node => {
|
||||||
match c {
|
match c {
|
||||||
'@' => {
|
'@' => {
|
||||||
if buf == "" {
|
if buf.is_empty() {
|
||||||
return Err(JidParseError::EmptyNode);
|
return Err(JidParseError::EmptyNode);
|
||||||
}
|
}
|
||||||
state = ParserState::Domain;
|
state = ParserState::Domain;
|
||||||
|
@ -341,7 +341,7 @@ fn _from_str(s: &str) -> Result<StringJid, JidParseError> {
|
||||||
buf.clear();
|
buf.clear();
|
||||||
}
|
}
|
||||||
'/' => {
|
'/' => {
|
||||||
if buf == "" {
|
if buf.is_empty() {
|
||||||
return Err(JidParseError::NoDomain);
|
return Err(JidParseError::NoDomain);
|
||||||
}
|
}
|
||||||
state = ParserState::Resource;
|
state = ParserState::Resource;
|
||||||
|
@ -356,7 +356,7 @@ fn _from_str(s: &str) -> Result<StringJid, JidParseError> {
|
||||||
ParserState::Domain => {
|
ParserState::Domain => {
|
||||||
match c {
|
match c {
|
||||||
'/' => {
|
'/' => {
|
||||||
if buf == "" {
|
if buf.is_empty() {
|
||||||
return Err(JidParseError::NoDomain);
|
return Err(JidParseError::NoDomain);
|
||||||
}
|
}
|
||||||
state = ParserState::Resource;
|
state = ParserState::Resource;
|
||||||
|
@ -683,9 +683,9 @@ impl IntoAttributeValue for Jid {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "minidom")]
|
#[cfg(feature = "minidom")]
|
||||||
impl Into<Node> for Jid {
|
impl From<Jid> for Node {
|
||||||
fn into(self) -> Node {
|
fn from(jid: Jid) -> Node {
|
||||||
Node::Text(String::from(self))
|
Node::Text(String::from(jid))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -697,9 +697,9 @@ impl IntoAttributeValue for FullJid {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "minidom")]
|
#[cfg(feature = "minidom")]
|
||||||
impl Into<Node> for FullJid {
|
impl From<FullJid> for Node {
|
||||||
fn into(self) -> Node {
|
fn from(jid: FullJid) -> Node {
|
||||||
Node::Text(String::from(self))
|
Node::Text(String::from(jid))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,9 +711,9 @@ impl IntoAttributeValue for BareJid {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "minidom")]
|
#[cfg(feature = "minidom")]
|
||||||
impl Into<Node> for BareJid {
|
impl From<BareJid> for Node {
|
||||||
fn into(self) -> Node {
|
fn from(jid: BareJid) -> Node {
|
||||||
Node::Text(String::from(self))
|
Node::Text(String::from(jid))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue