zpool_status.rs - indented_list_to_tree: do not set name property

This is no necessary. We only touch/set 'children' and 'leaf' properties.
This commit is contained in:
Dietmar Maurer 2020-06-20 07:19:25 +02:00
parent 42d19fdf69
commit 3bbe291c51

View File

@ -207,8 +207,6 @@ where
children_of_parent: Vec::new(), children_of_parent: Vec::new(),
}; };
cur.node.insert("name".to_string(), Value::String("root".to_string()));
for item in items { for item in items {
let (node, node_level) = to_node(&item); let (node, node_level) = to_node(&item);
let vdev_level = 1 + node_level; let vdev_level = 1 + node_level;
@ -339,7 +337,6 @@ fn test_vdev_list_to_tree() {
\"leaf\":false,\ \"leaf\":false,\
\"lvl\":1,\"name\":\"vdev4\"\ \"lvl\":1,\"name\":\"vdev4\"\
}],\ }],\
\"name\":\"root\",\
\"leaf\":false\ \"leaf\":false\
}"; }";
let expected: Value = serde_json::from_str(EXPECTED) let expected: Value = serde_json::from_str(EXPECTED)