*: Remove lazy_static in favor of once_cell (#3110)

This commit is contained in:
Hannes
2022-11-14 05:24:52 +01:00
committed by GitHub
parent 8b378d56d3
commit 7daa0c1145
6 changed files with 19 additions and 19 deletions

View File

@ -27,8 +27,8 @@ use futures::{
task::Context,
task::Poll,
};
use lazy_static::lazy_static;
use multiaddr::{Multiaddr, Protocol};
use once_cell::sync::Lazy;
use parking_lot::Mutex;
use rw_stream_sink::RwStreamSink;
use std::{
@ -38,9 +38,7 @@ use std::{
pin::Pin,
};
lazy_static! {
static ref HUB: Hub = Hub(Mutex::new(FnvHashMap::default()));
}
static HUB: Lazy<Hub> = Lazy::new(|| Hub(Mutex::new(FnvHashMap::default())));
struct Hub(Mutex<FnvHashMap<NonZeroU64, ChannelSender>>);