From c6524205023f70221cfd67adfc56b3e921bec3f5 Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Tue, 20 Aug 2024 07:32:07 -0400 Subject: [PATCH] clarify docstring for `MastForest::remove_nodes` --- core/src/mast/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/mast/mod.rs b/core/src/mast/mod.rs index 1f9471b85..1fba097c7 100644 --- a/core/src/mast/mod.rs +++ b/core/src/mast/mod.rs @@ -136,7 +136,10 @@ impl MastForest { } } - /// Removes all nodes in the provided set from the MAST forest. + /// Removes all nodes in the provided set from the MAST forest. The nodes MUST be orphaned (i.e. + /// have no parent). Otherwise, this parent's reference is considered "dangling" after the + /// removal (i.e. will point to an incorrect node after the removal), and this removal operation + /// would result in an invalid [`MastForest`]. /// /// It also returns the map from old node IDs to new node IDs; or `None` if the set of nodes to /// remove was empty. Any [`MastNodeId`] used in reference to the old [`MastForest`] should be