diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 8d45dbd..19c0cd7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: GPL-3.0-only -#![feature(const_extern_fn, async_closure)] +#![feature(const_extern_fn, async_closure, lazy_cell)] #![deny( warnings, nonstandard_style, @@ -38,9 +38,8 @@ mod xml; #[macro_use] extern crate log; -use std::sync::Mutex; +use std::sync::{LazyLock, Mutex}; -use once_cell::sync::Lazy; use pickledb::PickleDb; use tokio::time::Instant; @@ -49,7 +48,7 @@ const ERROR_HANDLER_RESPONSE: &str = refreshing the page, if that doesn't change anything; contact Fuwn! \ -static DATABASE: Lazy<Mutex<PickleDb>> = Lazy::new(|| { +static DATABASE: LazyLock<Mutex<PickleDb>> = LazyLock::new(|| { Mutex::new({ if std::fs::File::open(".locus/locus.db").is_ok() { PickleDb::load_json( |