Skip to content

Commit c88622a

Browse files
committed
fix: remove redundant trait
Signed-off-by: Woshiluo Luo <woshiluo.luo@outlook.com>
1 parent a76362d commit c88622a

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/utils/mod.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
use crate::buildin::Node;
22

3-
pub trait DeviceTreeTraversal {
4-
fn find(&self, _path: &str) -> Option<Node> {
5-
None
6-
}
7-
fn search<F>(&self, _func: &mut F)
8-
where
9-
F: FnMut(&Node),
10-
{
11-
}
12-
}
13-
14-
impl DeviceTreeTraversal for Node<'_> {
3+
impl Node<'_> {
154
/// Try to get a node by path
16-
fn find(&self, path: &str) -> Option<Node> {
5+
pub fn find(&self, path: &str) -> Option<Node> {
176
// Direct return root node
187
let mut current_node = Some(self.clone());
198
if path == "/" {
@@ -49,7 +38,7 @@ impl DeviceTreeTraversal for Node<'_> {
4938
}
5039

5140
/// use depth-first search to traversal the tree, and exec func for each node
52-
fn search<F>(&self, func: &mut F)
41+
pub fn search<F>(&self, func: &mut F)
5342
where
5443
F: FnMut(&Node),
5544
{

0 commit comments

Comments
 (0)