From cbf3afd59218edff2249f727c98b69b1a00ed686 Mon Sep 17 00:00:00 2001 From: rkscv Date: Fri, 6 Sep 2024 10:33:04 +0800 Subject: [PATCH] use `AtomicBool::fetch_not` --- Cargo.toml | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0e04b4b..c20c91a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "danmaku" version = "0.0.0" edition = "2021" -rust-version = "1.80" +rust-version = "1.81" [lib] crate-type = ["cdylib"] diff --git a/src/lib.rs b/src/lib.rs index fe49d39..90ac46b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -202,7 +202,7 @@ async fn main() -> c_int { { let arg1 = unsafe { CStr::from_ptr(*arg1) }; if arg1 == c"toggle-danmaku" { - if ENABLED.fetch_xor(true, Ordering::SeqCst) { + if ENABLED.fetch_not(Ordering::SeqCst) { handle.abort(); remove_overlay(); osd_message("Danmaku: off");