jingle: Remove unused clones.

This commit is contained in:
Emmanuel Gil Peyrot 2017-05-24 23:38:44 +01:00
parent 9bd1e7f295
commit 17d6959606

View file

@ -381,16 +381,16 @@ impl TryFrom<Element> for Jingle {
for child in root.children().cloned() { for child in root.children().cloned() {
if child.is("content", ns::JINGLE) { if child.is("content", ns::JINGLE) {
let content = Content::try_from(child.clone())?; let content = Content::try_from(child)?;
jingle.contents.push(content); jingle.contents.push(content);
} else if child.is("reason", ns::JINGLE) { } else if child.is("reason", ns::JINGLE) {
if jingle.reason.is_some() { if jingle.reason.is_some() {
return Err(Error::ParseError("Jingle must not have more than one reason.")); return Err(Error::ParseError("Jingle must not have more than one reason."));
} }
let reason = ReasonElement::try_from(child.clone())?; let reason = ReasonElement::try_from(child)?;
jingle.reason = Some(reason); jingle.reason = Some(reason);
} else { } else {
jingle.other.push(child.clone()); jingle.other.push(child);
} }
} }