From c59bdaff41e037510c25dc91b09fce1e3044e945 Mon Sep 17 00:00:00 2001 From: Alex Koshelev Date: Sat, 9 Mar 2024 21:00:24 -0800 Subject: [PATCH] Remove unused code --- ipa-core/src/helpers/error.rs | 52 ++--------------------------------- ipa-core/src/helpers/mod.rs | 2 +- 2 files changed, 3 insertions(+), 51 deletions(-) diff --git a/ipa-core/src/helpers/error.rs b/ipa-core/src/helpers/error.rs index 9de2b24bb..9f4fd2156 100644 --- a/ipa-core/src/helpers/error.rs +++ b/ipa-core/src/helpers/error.rs @@ -2,25 +2,13 @@ use thiserror::Error; use crate::{ error::BoxError, - helpers::{ChannelId, HelperChannelId, HelperIdentity, Role, TotalRecords, TransportIdentity}, - protocol::{step::Gate, RecordId}, + helpers::{ChannelId, TotalRecords, TransportIdentity}, + protocol::RecordId, }; /// An error raised by the IPA supporting infrastructure. #[derive(Error, Debug)] pub enum Error { - #[error("An error occurred while sending data to {channel:?}: {inner}")] - SendError { - channel: ChannelId, - - #[source] - inner: BoxError, - }, - #[error("An error occurred while sending data to unknown helper: {inner}")] - PollSendError { - #[source] - inner: BoxError, - }, #[error("An error occurred while receiving data from {source:?}/{step}: {inner}")] ReceiveError { source: I, @@ -33,15 +21,6 @@ pub enum Error { // TODO(mt): add more fields, like step and role. record_id: RecordId, }, - #[error("An error occurred while serializing or deserializing data for {record_id:?} and step {step}: {inner}")] - SerializationError { - record_id: RecordId, - step: String, - #[source] - inner: BoxError, - }, - #[error("Encountered unknown identity {0:?}")] - UnknownIdentity(HelperIdentity), #[error("record ID {record_id:?} is out of range for {channel_id:?} (expected {total_records:?} records)")] TooManyRecords { record_id: RecordId, @@ -49,30 +28,3 @@ pub enum Error { total_records: TotalRecords, }, } - -impl Error { - pub fn send_error>>( - channel: HelperChannelId, - inner: E, - ) -> Self { - Self::SendError { - channel, - inner: inner.into(), - } - } - - #[must_use] - pub fn serialization_error>( - record_id: RecordId, - gate: &Gate, - inner: E, - ) -> Self { - Self::SerializationError { - record_id, - step: String::from(gate.as_ref()), - inner: inner.into(), - } - } -} - -pub type Result = std::result::Result>; diff --git a/ipa-core/src/helpers/mod.rs b/ipa-core/src/helpers/mod.rs index 5a1105a05..d75093db2 100644 --- a/ipa-core/src/helpers/mod.rs +++ b/ipa-core/src/helpers/mod.rs @@ -17,7 +17,7 @@ use std::ops::{Index, IndexMut}; /// to validate that transport can actually send streams of this type #[cfg(test)] pub use buffers::OrderingSender; -pub use error::{Error, Result}; +pub use error::Error; #[cfg(feature = "stall-detection")] mod gateway_exports {