node: use swap_remove for attributes

This commit is contained in:
Matt Bilker
2019-09-11 06:55:12 +00:00
parent e407239cd5
commit b8bf1c1bfb

View File

@@ -200,7 +200,7 @@ impl Node {
}
pub fn remove_attr(&mut self, key: &str) -> Option<String> {
self.attributes.as_mut().and_then(|attributes| attributes.remove(key))
self.attributes.as_mut().and_then(|attributes| attributes.swap_remove(key))
}
pub fn sort_attrs(&mut self) {