mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 14:00:31 +08:00
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:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user