From a79c95283b5d3794e57c90f88b8c6a014853a378 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Sat, 26 Nov 2022 17:51:07 +0100 Subject: [PATCH] Minor doc and instance changes Signed-off-by: Alexis Sellier --- radicle-crdt/src/redactable.rs | 2 +- radicle/src/cob/thread.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/radicle-crdt/src/redactable.rs b/radicle-crdt/src/redactable.rs index 2fc83511..55e0f0cf 100644 --- a/radicle-crdt/src/redactable.rs +++ b/radicle-crdt/src/redactable.rs @@ -5,7 +5,7 @@ use crate::Semilattice; /// The "redacted" state is the top-most element and takes precedence /// over other states. /// -/// There is no `Default` instance, as it wouldn't obbey semilattice laws. +/// There is no `Default` instance, since this is not a "bounded" semilattice. /// /// Nb. The merge rules are such that if two redactables with different /// values present are merged; the result is redacted. This is the preserve diff --git a/radicle/src/cob/thread.rs b/radicle/src/cob/thread.rs index a092739b..cc39775d 100644 --- a/radicle/src/cob/thread.rs +++ b/radicle/src/cob/thread.rs @@ -1,3 +1,4 @@ +use std::cmp::Ordering; use std::collections::btree_map::Entry; use std::collections::BTreeMap; use std::ops::{ControlFlow, Deref, DerefMut}; @@ -42,8 +43,12 @@ impl Comment { } impl PartialOrd for Comment { - fn partial_cmp(&self, _other: &Self) -> Option { - None + fn partial_cmp(&self, other: &Self) -> Option { + if self == other { + Some(Ordering::Equal) + } else { + None + } } }