diff --git a/Cargo.lock b/Cargo.lock index dc612eb409..51a55f62bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5670,6 +5670,7 @@ dependencies = [ "bitflags", "bytes", "criterion", + "hashbrown", "prometheus", "rand 0.8.3", "tokio", diff --git a/network/protocol/Cargo.toml b/network/protocol/Cargo.toml index 5b06792fc9..4043ac488f 100644 --- a/network/protocol/Cargo.toml +++ b/network/protocol/Cargo.toml @@ -24,6 +24,7 @@ rand = { version = "0.8" } # async traits async-trait = "0.1.42" bytes = "^1" +hashbrown = { version = ">=0.9, <0.12" } [dev-dependencies] async-channel = "1.5.1" diff --git a/network/protocol/src/quic.rs b/network/protocol/src/quic.rs index a4dfa328d1..cd76c0b3ef 100644 --- a/network/protocol/src/quic.rs +++ b/network/protocol/src/quic.rs @@ -12,10 +12,8 @@ use crate::{ }; use async_trait::async_trait; use bytes::BytesMut; -use std::{ - collections::HashMap, - time::{Duration, Instant}, -}; +use hashbrown::HashMap; +use std::time::{Duration, Instant}; use tracing::info; #[cfg(feature = "trace_pedantic")] use tracing::trace; diff --git a/network/protocol/src/tcp.rs b/network/protocol/src/tcp.rs index e6c74df4d4..0909336a58 100644 --- a/network/protocol/src/tcp.rs +++ b/network/protocol/src/tcp.rs @@ -11,10 +11,8 @@ use crate::{ }; use async_trait::async_trait; use bytes::BytesMut; -use std::{ - collections::HashMap, - time::{Duration, Instant}, -}; +use hashbrown::HashMap; +use std::time::{Duration, Instant}; use tracing::info; #[cfg(feature = "trace_pedantic")] use tracing::trace;