mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
eme: Remove two clones.
This commit is contained in:
parent
b172a6e05c
commit
070227ea03
1 changed files with 4 additions and 6 deletions
10
src/eme.rs
10
src/eme.rs
|
@ -28,11 +28,9 @@ impl TryFrom<Element> for ExplicitMessageEncryption {
|
|||
for _ in elem.children() {
|
||||
return Err(Error::ParseError("Unknown child in encryption element."));
|
||||
}
|
||||
let namespace = get_attr!(elem, "namespace", required);
|
||||
let name = get_attr!(elem, "name", optional);
|
||||
Ok(ExplicitMessageEncryption {
|
||||
namespace: namespace,
|
||||
name: name,
|
||||
namespace: get_attr!(elem, "namespace", required),
|
||||
name: get_attr!(elem, "name", optional),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -41,8 +39,8 @@ impl Into<Element> for ExplicitMessageEncryption {
|
|||
fn into(self) -> Element {
|
||||
Element::builder("encryption")
|
||||
.ns(ns::EME)
|
||||
.attr("namespace", self.namespace.clone())
|
||||
.attr("name", self.name.clone())
|
||||
.attr("namespace", self.namespace)
|
||||
.attr("name", self.name)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue