diff --git a/scylla/src/transport/metrics.rs b/scylla/src/transport/metrics.rs index 8bc5df554c..85f7ed4913 100644 --- a/scylla/src/transport/metrics.rs +++ b/scylla/src/transport/metrics.rs @@ -1,30 +1,23 @@ use histogram::Histogram; use std::sync::atomic::{AtomicU64, Ordering}; -use std::sync::{Arc, Mutex, MutexGuard, PoisonError}; +use std::sync::{Arc, Mutex}; const ORDER_TYPE: Ordering = Ordering::Relaxed; #[derive(Debug)] -pub enum MetricsError<'a> { - Poison(PoisonError>), - Histogram(&'static str), +pub struct MetricsError { + cause: &'static str, } -impl<'a> From>> for MetricsError<'a> { - fn from(err: PoisonError>) -> MetricsError { - MetricsError::Poison(err) - } -} - -impl From<&'static str> for MetricsError<'_> { +impl From<&'static str> for MetricsError { fn from(err: &'static str) -> MetricsError { - MetricsError::Histogram(err) + MetricsError { cause: err } } } -impl std::fmt::Display for MetricsError<'_> { +impl std::fmt::Display for MetricsError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self) + write!(f, "metrics error: {}", self.cause) } }