diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 5066b36..1fca737 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "metrics" -version = "0.9.0" +version = "0.9.1" authors = ["Toby Lawrence "] edition = "2018" @@ -35,9 +35,9 @@ hashbrown = "^0.1" quanta = "^0.2" futures = "^0.1" tokio-sync = "^0.1" -metrics-exporter-log = { path = "../metrics-exporter-log", version = "^0.1", optional = true } -metrics-recorder-text = { path = "../metrics-recorder-text", version = "^0.1", optional = true } -metrics-recorder-prometheus = { path = "../metrics-recorder-prometheus", version = "^0.1", optional = true } +metrics-exporter-log = { path = "../metrics-exporter-log", version = "^0.2", optional = true } +metrics-recorder-text = { path = "../metrics-recorder-text", version = "^0.2", optional = true } +metrics-recorder-prometheus = { path = "../metrics-recorder-prometheus", version = "^0.2", optional = true } [dev-dependencies] log = "^0.4" diff --git a/metrics/src/control.rs b/metrics/src/control.rs index a9a56d6..6cc114d 100644 --- a/metrics/src/control.rs +++ b/metrics/src/control.rs @@ -1,9 +1,9 @@ use super::data::snapshot::Snapshot; use crossbeam_channel::{bounded, Sender}; +use futures::prelude::*; +use metrics_core::{AsyncSnapshotProvider, SnapshotProvider}; use std::error::Error; use std::fmt; -use metrics_core::{SnapshotProvider, AsyncSnapshotProvider}; -use futures::prelude::*; use tokio_sync::oneshot; /// Error conditions when retrieving a snapshot. @@ -16,18 +16,13 @@ pub enum SnapshotError { ReceiverShutdown, } -impl Error for SnapshotError { -} +impl Error for SnapshotError {} impl fmt::Display for SnapshotError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - SnapshotError::InternalError => { - write!(f, "internal error while collecting snapshot") - }, - SnapshotError::ReceiverShutdown => { - write!(f, "receiver is shutdown") - }, + SnapshotError::InternalError => write!(f, "internal error while collecting snapshot"), + SnapshotError::ReceiverShutdown => write!(f, "receiver is shutdown"), } } } diff --git a/metrics/src/data/snapshot.rs b/metrics/src/data/snapshot.rs index 88760ce..e211c07 100644 --- a/metrics/src/data/snapshot.rs +++ b/metrics/src/data/snapshot.rs @@ -1,5 +1,5 @@ use super::histogram::HistogramSnapshot; -use metrics_core::{Snapshot as MetricsSnapshot, Recorder}; +use metrics_core::{Recorder, Snapshot as MetricsSnapshot}; use std::fmt::Display; /// A typed metric measurement, used in snapshots. @@ -122,7 +122,9 @@ mod tests { } fn record_histogram>(&mut self, key: K, values: &[u64]) { - let _ = self.histogram.insert(key.as_ref().to_owned(), values.to_vec()); + let _ = self + .histogram + .insert(key.as_ref().to_owned(), values.to_vec()); } } diff --git a/metrics/src/lib.rs b/metrics/src/lib.rs index 1e73abf..d268dc2 100644 --- a/metrics/src/lib.rs +++ b/metrics/src/lib.rs @@ -124,7 +124,10 @@ mod sink; #[cfg(any(feature = "metrics-exporter-log"))] pub mod exporters; -#[cfg(any(feature = "metrics-recorder-text", feature = "metrics-recorder-prometheus"))] +#[cfg(any( + feature = "metrics-recorder-text", + feature = "metrics-recorder-prometheus" +))] pub mod recorders; pub use self::{