Skip to content

Commit de0cf80

Browse files
committed
replace OnceCell with Once
1 parent 4ce36e6 commit de0cf80

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

annix/src/api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub use crate::player::PlayerStateEvent;
236236
pub use anni_player::AnniPlayer;
237237
use anni_player::TypedPriorityProvider;
238238
#[cfg(target_os = "windows")]
239-
use once_cell::sync::OnceCell;
239+
use std::sync::Once;
240240

241241
#[frb(mirror(ProgressState))]
242242
pub struct _ProgressState {
@@ -266,7 +266,7 @@ fn update_player_state_stream(
266266
pub type StreamWrapper<T> = Arc<OnceLock<RwLock<Option<StreamSink<T>>>>>;
267267

268268
#[cfg(target_os = "windows")]
269-
static LOGGER_INIT: OnceCell<()> = OnceCell::new();
269+
static LOGGER_INIT: Once = Once::new();
270270

271271
pub struct AnnixPlayer {
272272
pub player: RustOpaque<AnniPlayer>,
@@ -277,7 +277,7 @@ pub struct AnnixPlayer {
277277
impl AnnixPlayer {
278278
pub fn new(cache_path: String) -> SyncReturn<AnnixPlayer> {
279279
#[cfg(target_os = "windows")]
280-
LOGGER_INIT.get_or_init(|| env_logger::init());
280+
LOGGER_INIT.call_once(|| env_logger::init());
281281

282282
let (player, receiver) =
283283
AnniPlayer::new(TypedPriorityProvider::new(vec![]), cache_path.into());

0 commit comments

Comments
 (0)