From 61a9b2140f1f777ec7504ae58fbd4246deccbb5f Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Fri, 13 Feb 2026 08:35:01 +0000 Subject: [PATCH] protocol/service: introduce Result synonym Create a type synonym for `Result`, to simplify result types being returned by commands in a later change. --- crates/radicle-protocol/src/service/command.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/radicle-protocol/src/service/command.rs b/crates/radicle-protocol/src/service/command.rs index 4a5f3e5f..b1f12994 100644 --- a/crates/radicle-protocol/src/service/command.rs +++ b/crates/radicle-protocol/src/service/command.rs @@ -13,7 +13,12 @@ use thiserror::Error; use super::ServiceState; /// Function used to query internal service state. -pub type QueryState = dyn Fn(&dyn ServiceState) -> Result<(), Error> + Send + Sync; +pub type QueryState = dyn Fn(&dyn ServiceState) -> Result<()> + Send + Sync; + +/// A result returned from processing a [`Command`]. +/// +/// It is a type synonym for a [`std::result::Result`] +pub type Result = std::result::Result; /// Commands sent to the service by the operator. pub enum Command { @@ -45,7 +50,7 @@ pub enum Command { /// Unfollow the given node. Unfollow(NodeId, Sender), /// Query the internal service state. - QueryState(Arc, Sender>), + QueryState(Arc, Sender>), } impl fmt::Debug for Command {