aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/hosts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/net/hosts.rs')
-rw-r--r--components/net/hosts.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/components/net/hosts.rs b/components/net/hosts.rs
index 6a59e04c76a..48b74bba154 100644
--- a/components/net/hosts.rs
+++ b/components/net/hosts.rs
@@ -8,13 +8,10 @@ use std::env;
use std::fs::File;
use std::io::{BufReader, Read};
use std::net::{IpAddr, Ipv4Addr};
-use std::sync::Mutex;
+use std::sync::{LazyLock, Mutex};
-use lazy_static::lazy_static;
-
-lazy_static! {
- static ref HOST_TABLE: Mutex<Option<HashMap<String, IpAddr>>> = Mutex::new(create_host_table());
-}
+static HOST_TABLE: LazyLock<Mutex<Option<HashMap<String, IpAddr>>>> =
+ LazyLock::new(|| Mutex::new(create_host_table()));
fn create_host_table() -> Option<HashMap<String, IpAddr>> {
let path = env::var_os("HOST_FILE")?;