2022 rust day 7 refactor

This commit is contained in:
Maciej Jur 2022-12-07 19:19:37 +01:00
parent 276b515e6d
commit 1b17aab1bc

View file

@ -46,9 +46,7 @@ fn cli_to_tree(data: &[CliEntry]) -> Box<Node> {
}; };
} }
else { else {
current = &mut *current.subdirs.iter_mut() current = current.subdirs.iter_mut().find(|dir| dir.name == name).unwrap();
.find(|next| next.name == name)
.unwrap();
} }
}, },
CliEntry::Ls => {}, CliEntry::Ls => {},