We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
FdtNode::child
Fdt::find_node
1 parent 87b2daa commit fa60072Copy full SHA for fa60072
1 file changed
src/fdt/mod.rs
@@ -425,18 +425,8 @@ impl<'a> Fdt<'a> {
425
return Ok(Some(current_node));
426
}
427
for component in path.split('/').filter(|s| !s.is_empty()) {
428
- let include_address = component.contains('@');
429
- match current_node.children().find(|child| {
430
- child.as_ref().is_ok_and(|c| {
431
- if include_address {
432
- c.name().is_ok_and(|n| n == component)
433
- } else {
434
- c.name_without_address().is_ok_and(|n| n == component)
435
- }
436
- })
437
- }) {
438
- Some(Ok(node)) => current_node = node,
439
- Some(Err(e)) => return Err(e),
+ match current_node.child(component)? {
+ Some(node) => current_node = node,
440
None => return Ok(None),
441
442
0 commit comments