Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
refactor: use shorter name for NodeEventError
Lars Wirzenius committed 1 year ago
commit 72f09aa9f64d456eb88da9f0b89a0bccc5822fc7
parent edc6cb407db7d4d7878d1d2b6b98e26b8ec5b13d
1 file changed +8 -5
modified src/event.rs
@@ -41,7 +41,10 @@ use std::{
    path::{Path, PathBuf},
};

-
use crate::{event_source::NodeEventSource, logger};
+
use crate::{
+
    event_source::{NodeEventError, NodeEventSource},
+
    logger,
+
};

/// Source of events from the local Radicle node.
///
@@ -84,7 +87,7 @@ impl BrokerEventSource {
    /// error.
    pub fn node_event(&mut self) -> Result<Option<Event>, BrokerEventError> {
        match self.source.node_event() {
-
            Err(crate::event_source::NodeEventError::BrokenConnection) => {
+
            Err(NodeEventError::BrokenConnection) => {
                logger::event_disconnected();
                Err(BrokerEventError::BrokenConnection)
            }
@@ -102,7 +105,7 @@ impl BrokerEventSource {
    pub fn event(&mut self) -> Result<Vec<BrokerEvent>, BrokerEventError> {
        loop {
            match self.source.node_event() {
-
                Err(crate::event_source::NodeEventError::BrokenConnection) => {
+
                Err(NodeEventError::BrokenConnection) => {
                    logger::event_disconnected();
                    return Err(BrokerEventError::BrokenConnection);
                }
@@ -137,7 +140,7 @@ impl BrokerEventSource {
pub enum BrokerEventError {
    /// Can't create a [`NodeEventSource`].
    #[error("failed to subscribe to node events")]
-
    CannotSubscribe(#[source] crate::event_source::NodeEventError),
+
    CannotSubscribe(#[source] NodeEventError),

    /// Regex compilation error.
    #[error("programming error in regular expression {0:?}")]
@@ -149,7 +152,7 @@ pub enum BrokerEventError {

    /// Some error from getting an event from the node.
    #[error("failed to get next event from node")]
-
    NodeEventError(#[from] crate::event_source::NodeEventError),
+
    NodeEventError(#[from] NodeEventError),

    /// Connection to the node control socket broke.
    #[error("connection to the node control socket broke")]