From 38ff2652b1290cd3a368058e4be0613975f20de7 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Thu, 3 Jul 2025 14:08:06 +0100 Subject: [PATCH] radicle: remove unnecessary constraints The constraints on some of the `cob` related traits are unnecessary, so this patch removes them. --- crates/radicle-cob/src/object/collaboration.rs | 2 +- crates/radicle/src/cob/store.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/radicle-cob/src/object/collaboration.rs b/crates/radicle-cob/src/object/collaboration.rs index 97e6a751..2236f97e 100644 --- a/crates/radicle-cob/src/object/collaboration.rs +++ b/crates/radicle-cob/src/object/collaboration.rs @@ -63,7 +63,7 @@ impl CollaborativeObject { } /// An object that can be built by evaluating a history. -pub trait Evaluate: Sized + Debug + 'static { +pub trait Evaluate: Sized { type Error: std::error::Error + Send + Sync + 'static; /// Initialize the object with the first (root) history entry. diff --git a/crates/radicle/src/cob/store.rs b/crates/radicle/src/cob/store.rs index b69e9698..cc3b1c36 100644 --- a/crates/radicle/src/cob/store.rs +++ b/crates/radicle/src/cob/store.rs @@ -17,7 +17,7 @@ use crate::storage::git as storage; use crate::storage::SignRepository; use crate::{cob, identity}; -pub trait CobAction: Debug { +pub trait CobAction { /// Parent objects this action depends on. For example, patch revisions /// have the commit objects as their parent. fn parents(&self) -> Vec { @@ -43,7 +43,7 @@ pub trait CobAction: Debug { } /// A collaborative object. Can be materialized from an operation history. -pub trait Cob: Sized + PartialEq + Debug { +pub trait Cob: Sized { /// The underlying action composing each operation. type Action: CobAction + for<'de> Deserialize<'de> + Serialize; /// Error returned by `apply` function. @@ -331,7 +331,7 @@ where impl<'a, T, R> Store<'a, T, R> where R: ReadRepository + cob::Store, - T: Cob + cob::Evaluate, + T: Cob + cob::Evaluate + 'a, T::Action: Serialize, { /// Get an object.