Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Jan 9, 2025
1 parent e9f8853 commit cf115d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions crates/torin/examples/demo.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::{
collections::HashMap,
sync::Arc,
};
use std::collections::HashMap;

use torin::prelude::*;

Expand Down
4 changes: 1 addition & 3 deletions crates/torin/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ impl TestingDOM {
}

pub fn remove(&mut self, node_id: usize) {
let node = self.mapper.get(&node_id).unwrap().clone();
let node = self.mapper.remove(&node_id).unwrap();

if let Some((_, parent_children, _, _)) = node.0.and_then(|p| self.mapper.get_mut(&p)) {
parent_children.retain(|c| *c != node_id);
}

self.mapper.remove(&node_id);

for child in node.1 {
self.remove(child);
}
Expand Down

0 comments on commit cf115d7

Please sign in to comment.