eme: Remove two clones.

This commit is contained in:
Emmanuel Gil Peyrot 2017-05-25 00:30:00 +01:00
parent b172a6e05c
commit 070227ea03

View file

@ -28,11 +28,9 @@ impl TryFrom<Element> for ExplicitMessageEncryption {
for _ in elem.children() { for _ in elem.children() {
return Err(Error::ParseError("Unknown child in encryption element.")); 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 { Ok(ExplicitMessageEncryption {
namespace: namespace, namespace: get_attr!(elem, "namespace", required),
name: name, name: get_attr!(elem, "name", optional),
}) })
} }
} }
@ -41,8 +39,8 @@ impl Into<Element> for ExplicitMessageEncryption {
fn into(self) -> Element { fn into(self) -> Element {
Element::builder("encryption") Element::builder("encryption")
.ns(ns::EME) .ns(ns::EME)
.attr("namespace", self.namespace.clone()) .attr("namespace", self.namespace)
.attr("name", self.name.clone()) .attr("name", self.name)
.build() .build()
} }
} }