INNER CODE UNIT · Rust
find_node_mut
mufeedvh/code2prompt · crates/code2prompt/src/model/mod.rs:73
pub fn find_node_mut(&mut self, target_path: &std::path::Path) -> Option<&mut DisplayFileNode> {
if self.path == target_path {
return Some(self);
}
for child in &mut self.children {
if let Some(found) = child.find_node_mut(target_path) {
return Some(found);
}
}
None
}
/// Load children for this directory node
pub fn load_children(
&mut self,
session: &mut code2prompt_core::session::Code2PromptSession,