mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
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:
@@ -73,7 +73,6 @@ mod uuid_generation {
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord, serde::Serialize, serde::Deserialize, specta::Type, DynAny)]
|
||||
pub struct NodeId(pub u64);
|
||||
|
||||
// TODO: Find and replace all `NodeId(generate_uuid())` with `NodeId::new()`.
|
||||
impl NodeId {
|
||||
pub fn new() -> Self {
|
||||
Self(generate_uuid())
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user