Only use .cloned() on the element instead of the entire iterator

This commit is contained in:
julianbraha 2024-08-29 14:12:26 +01:00 committed by Victoria Brekenfeld
parent 06d25df4ef
commit 59b0e0e74e

View file

@ -1432,7 +1432,7 @@ impl TilingLayout {
group.remove_window(position);
} else {
trace!("Removing Group");
let other_child = tree.children_ids(&id).unwrap().cloned().next().unwrap();
let other_child = tree.children_ids(&id).unwrap().next().cloned().unwrap();
let fork_pos = parent_parent_id.as_ref().and_then(|parent_id| {
tree.children_ids(parent_id).unwrap().position(|i| i == &id)
});
@ -2984,8 +2984,8 @@ impl TilingLayout {
let child_id = tree
.children_ids(&node_id)
.unwrap()
.cloned()
.next()
.cloned()
.unwrap();
tree.remove_node(node_id, RemoveBehavior::LiftChildren)
.unwrap();