Change unnecessary mut variable to default immutable

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-06-12 18:22:51 +02:00
parent efb283f6fe
commit aacfcc58b9
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -347,14 +347,14 @@ impl Element {
Event::Text(s) => { Event::Text(s) => {
let text = s.unescape_and_decode(reader)?; let text = s.unescape_and_decode(reader)?;
if text != "" { if text != "" {
let mut current_elem = stack.last_mut().unwrap(); let current_elem = stack.last_mut().unwrap();
current_elem.append_text_node(text); current_elem.append_text_node(text);
} }
}, },
Event::CData(s) => { Event::CData(s) => {
let text = reader.decode(&s).into_owned(); let text = reader.decode(&s).into_owned();
if text != "" { if text != "" {
let mut current_elem = stack.last_mut().unwrap(); let current_elem = stack.last_mut().unwrap();
current_elem.append_text_node(text); current_elem.append_text_node(text);
} }
}, },