Clean up old usages of NodeId(generate_uuid()) by replacing it with NodeId::new() (#2009)

Replace all `NodeId(generate_uuid())` with `NodeId::new()`
This commit is contained in:
Mohamed Osama 2024-10-26 05:43:46 +03:00 committed by GitHub
parent dae6b2f239
commit 3c839ffd2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 46 additions and 61 deletions

View file

@ -747,11 +747,11 @@ fn migrate_layer_to_merge<'de, D: serde::Deserializer<'de>>(deserializer: D) ->
}
// TODO: Eventually remove this (probably starting late 2024)
fn default_import_metadata() -> (NodeId, IVec2) {
(NodeId(generate_uuid()), IVec2::new(-25, -4))
(NodeId::new(), IVec2::new(-25, -4))
}
// TODO: Eventually remove this (probably starting late 2024)
fn default_export_metadata() -> (NodeId, IVec2) {
(NodeId(generate_uuid()), IVec2::new(8, -4))
(NodeId::new(), IVec2::new(8, -4))
}
#[derive(Clone, Default, Debug, DynAny)]
@ -1016,7 +1016,7 @@ impl NodeNetwork {
/// Remove all nodes that contain [`DocumentNodeImplementation::Network`] by moving the nested nodes into the parent network.
pub fn flatten(&mut self, node_id: NodeId) {
self.flatten_with_fns(node_id, merge_ids, || NodeId(generate_uuid()))
self.flatten_with_fns(node_id, merge_ids, || NodeId::new())
}
/// Remove all nodes that contain [`DocumentNodeImplementation::Network`] by moving the nested nodes into the parent network.