From d5c07866631c2983b9bbde1c949aea8ef091a675 Mon Sep 17 00:00:00 2001 From: Sishan Long Date: Fri, 22 Sep 2023 16:48:54 -0700 Subject: [PATCH] fix lint --- crates/hotshot/src/traits/networking.rs | 3 +-- crates/hotshot/src/traits/networking/libp2p_network.rs | 1 - crates/types/src/traits/metrics.rs | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/hotshot/src/traits/networking.rs b/crates/hotshot/src/traits/networking.rs index 017fae77ec..e1ac026546 100644 --- a/crates/hotshot/src/traits/networking.rs +++ b/crates/hotshot/src/traits/networking.rs @@ -9,12 +9,11 @@ pub mod libp2p_network; pub mod memory_network; pub mod web_server_libp2p_fallback; pub mod web_server_network; - +use hotshot_types::traits::metrics::{Counter, Gauge, Metrics}; pub use hotshot_types::traits::network::{ ChannelSendSnafu, CouldNotDeliverSnafu, FailedToDeserializeSnafu, FailedToSerializeSnafu, NetworkError, NetworkReliability, NoSuchNodeSnafu, ShutDownSnafu, }; -use hotshot_types::traits::metrics::{Counter, Gauge, Metrics}; /// Contains the metrics that we're interested in from the networking interfaces #[derive(Clone)] diff --git a/crates/hotshot/src/traits/networking/libp2p_network.rs b/crates/hotshot/src/traits/networking/libp2p_network.rs index 1cea7633c1..ac949a331f 100644 --- a/crates/hotshot/src/traits/networking/libp2p_network.rs +++ b/crates/hotshot/src/traits/networking/libp2p_network.rs @@ -441,7 +441,6 @@ impl Libp2pNetwork { let connected_num = handle.num_connected().await?; metrics_connected_peers.set(connected_num); - while !is_bootstrapped.load(Ordering::Relaxed) { async_sleep(Duration::from_secs(1)).await; } diff --git a/crates/types/src/traits/metrics.rs b/crates/types/src/traits/metrics.rs index 78aaef7817..e326fca9bc 100644 --- a/crates/types/src/traits/metrics.rs +++ b/crates/types/src/traits/metrics.rs @@ -6,8 +6,8 @@ //! - [`Histogram`]: stores multiple float values based for a graph (example usage: CPU %) //! - [`Label`]: Stores the last string (example usage: current version, network online/offline) -use std::fmt::Debug; use dyn_clone::DynClone; +use std::fmt::Debug; /// The metrics type. pub trait Metrics: Send + Sync {