Skip to content

Commit 49efe27

Browse files
committed
remove one collect after appeasing the borrow checker
1 parent ea97704 commit 49efe27

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,10 +1995,11 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
19951995
lasso_selection_curr.push(node_graph_point);
19961996
}
19971997

1998-
let lasso_selection_viewport: Vec<DVec2> = lasso_selection_curr
1999-
.iter()
2000-
.map(|selection_point| network_metadata.persistent_metadata.navigation_metadata.node_graph_to_viewport.transform_point2(*selection_point))
2001-
.collect();
1998+
responses.add(FrontendMessage::UpdateLasso {
1999+
lasso_selection: Some(LassoSelection::from_iter(lasso_selection_curr.iter().map(|selection_point| {
2000+
network_metadata.persistent_metadata.navigation_metadata.node_graph_to_viewport.transform_point2(*selection_point)
2001+
}))),
2002+
});
20022003

20032004
let shift = ipp.keyboard.get(Key::Shift as usize);
20042005
let alt = ipp.keyboard.get(Key::Alt as usize);
@@ -2044,9 +2045,6 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
20442045
nodes: nodes.into_iter().collect::<Vec<_>>(),
20452046
});
20462047
}
2047-
responses.add(FrontendMessage::UpdateLasso {
2048-
lasso_selection: Some(LassoSelection::from_iter(lasso_selection_viewport.into_iter())),
2049-
})
20502048
}
20512049
}
20522050
NodeGraphMessage::UpdateImportsExports => {

0 commit comments

Comments
 (0)