radicle: remove FetchResult associated type

The Handle trait defines a FetchResult associated type. This type is
always instantiated to be the FetchResult enum in radicle::node.

Remove the associated type to simplify the trait.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
Fintan Halpenny
2023-02-27 17:17:00 +01:00
committed by Alexis Sellier
parent 06a92d52d9
commit c0b92d25fb
4 changed files with 6 additions and 11 deletions
+4 -4
View File
@@ -13,7 +13,7 @@ use serde_json as json;
use crate::identity::Id;
use crate::node::NodeId;
use crate::node::{Command, CommandName, CommandResult, FetchResult};
use crate::node::{Command, CommandName, CommandResult};
use crate::runtime;
#[derive(thiserror::Error, Debug)]
@@ -25,7 +25,7 @@ pub enum Error {
}
/// Listen for commands on the control socket, and process them.
pub fn listen<H: Handle<Error = runtime::HandleError, FetchResult = FetchResult>>(
pub fn listen<H: Handle<Error = runtime::HandleError>>(
listener: UnixListener,
mut handle: H,
) -> Result<(), Error> {
@@ -74,7 +74,7 @@ enum CommandError {
Shutdown,
}
fn command<H: Handle<Error = runtime::HandleError, FetchResult = FetchResult>>(
fn command<H: Handle<Error = runtime::HandleError>>(
stream: &UnixStream,
handle: &mut H,
) -> Result<(), CommandError> {
@@ -199,7 +199,7 @@ fn command<H: Handle<Error = runtime::HandleError, FetchResult = FetchResult>>(
Ok(())
}
fn fetch<W: Write, H: Handle<Error = runtime::HandleError, FetchResult = FetchResult>>(
fn fetch<W: Write, H: Handle<Error = runtime::HandleError>>(
id: Id,
node: NodeId,
mut writer: W,
-1
View File
@@ -107,7 +107,6 @@ impl<G: Signer + Ecdh + 'static> Handle<G> {
impl<G: Signer + Ecdh + 'static> radicle::node::Handle for Handle<G> {
type Sessions = Sessions;
type Error = Error;
type FetchResult = FetchResult;
fn is_running(&self) -> bool {
true
-1
View File
@@ -20,7 +20,6 @@ pub struct Handle {
impl radicle::node::Handle for Handle {
type Error = HandleError;
type Sessions = service::Sessions;
type FetchResult = FetchResult;
fn is_running(&self) -> bool {
true