diff --git a/src/node/mod.rs b/src/node/mod.rs index 37bf6b8..245ee41 100644 --- a/src/node/mod.rs +++ b/src/node/mod.rs @@ -200,7 +200,7 @@ impl Node { } pub fn remove_attr(&mut self, key: &str) -> Option { - 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) {