diff --git a/src/node/mod.rs b/src/node/mod.rs index e417c4c..37bf6b8 100644 --- a/src/node/mod.rs +++ b/src/node/mod.rs @@ -199,6 +199,10 @@ impl Node { attributes.insert(key.into(), value.into()) } + pub fn remove_attr(&mut self, key: &str) -> Option { + self.attributes.as_mut().and_then(|attributes| attributes.remove(key)) + } + pub fn sort_attrs(&mut self) { if let Some(ref mut attributes) = self.attributes { attributes.sort_keys();