From 392e83be42da8f371671083ddcd5ca129fd0451d Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 2 Jan 2024 16:11:31 +0900 Subject: [PATCH] op_heads: ensure that update_op_heads([id], id) fails The doc states it's invalid, but I made such bug. --- lib/src/simple_op_heads_store.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/simple_op_heads_store.rs b/lib/src/simple_op_heads_store.rs index 44e3928a3..7603ffed8 100644 --- a/lib/src/simple_op_heads_store.rs +++ b/lib/src/simple_op_heads_store.rs @@ -76,6 +76,7 @@ impl OpHeadsStore for SimpleOpHeadsStore { } fn update_op_heads(&self, old_ids: &[OperationId], new_id: &OperationId) { + assert!(!old_ids.contains(new_id)); self.add_op_head(new_id); for old_id in old_ids { self.remove_op_head(old_id)