mirror of
https://github.com/mbilker/kbinxml-rs.git
synced 2026-09-07 01:55:13 -05:00
node: add ability to remove attributes
This commit is contained in:
@@ -199,6 +199,10 @@ impl Node {
|
||||
attributes.insert(key.into(), value.into())
|
||||
}
|
||||
|
||||
pub fn remove_attr(&mut self, key: &str) -> Option<String> {
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user