mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-29 01:31:33 +00:00
*: Remove lazy_static in favor of once_cell (#3110)
This commit is contained in:
@ -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>>);
|
||||
|
||||
|
Reference in New Issue
Block a user