Skip to content

Commit

Permalink
use AtomicBool::fetch_not
Browse files Browse the repository at this point in the history
  • Loading branch information
rkscv committed Sep 6, 2024
1 parent c77c173 commit cbf3afd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "danmaku"
version = "0.0.0"
edition = "2021"
rust-version = "1.80"
rust-version = "1.81"

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit cbf3afd

Please sign in to comment.