diff --git a/Cargo.toml b/Cargo.toml index f97c5bc..fa970ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ no-skip-if = [] [dependencies] bincode = { version = "1.3.3" } -hashbrown = { version = "0.14.0", features = ["serde"] } +hashbrown = { version = "0.15.0", features = ["serde"] } pyo3 = { version = "0.21.2", features = ["extension-module"], optional = true} serde = { version = "1", features = ["derive"] } serde_json = { version = "1.0.0" } diff --git a/src/diff.rs b/src/diff.rs index 0e27393..29d64a3 100644 --- a/src/diff.rs +++ b/src/diff.rs @@ -216,6 +216,14 @@ impl GraphDif Ok(()) } + /// # Safety + /// Does not check that the node IDs are valid (i.e. not marked as deleted). + /// CAUTION: This replaces the edge-diff by the provided one, potentially making `self` + /// internally inconsistent. + pub unsafe fn set_edges_unchecked(&mut self, edges: HashMap>) { + self.edges.new_or_updated = edges; + } + /// Add a new edge to be deleted to the diff. /// If present, the edge is removed from `new_or_updated`. pub fn delete_edge(&mut self, from: &Id, to: &Id) {