libfdt: Make properties of FdtNode outlive
Properties of FdtNode from Fdt::node() outlive than its node.
This CL makes the lifetime for subnodes() and descendants() consistent
with Fdt::node().
Bug: 317830919
Test: atest liblibfdt.integration_test
Change-Id: Id1b32a498ee63063c0b14bd4713135d238d76954
diff --git a/libs/libfdt/src/iterators.rs b/libs/libfdt/src/iterators.rs
index a524655..7406164 100644
--- a/libs/libfdt/src/iterators.rs
+++ b/libs/libfdt/src/iterators.rs
@@ -330,7 +330,7 @@
}
impl<'a> DescendantsIterator<'a> {
- pub(crate) fn new(node: &'a FdtNode) -> Self {
+ pub(crate) fn new(node: &FdtNode<'a>) -> Self {
Self { node: Some((*node, 0)) }
}
}
diff --git a/libs/libfdt/src/lib.rs b/libs/libfdt/src/lib.rs
index 14f0f37..d90f5f0 100644
--- a/libs/libfdt/src/lib.rs
+++ b/libs/libfdt/src/lib.rs
@@ -487,7 +487,7 @@
}
/// Returns an iterator of descendants
- pub fn descendants(&'a self) -> DescendantsIterator<'a> {
+ pub fn descendants(&self) -> DescendantsIterator<'a> {
DescendantsIterator::new(self)
}