Skip to content

Commit

Permalink
chore: More clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
poljar committed Oct 14, 2024
1 parent 9efaf78 commit 7f428b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/weechat/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ impl WeechatExecutor {

pub fn free() {
unsafe {
#[allow(static_mut_refs)]
_EXECUTOR.take();
}
}

pub fn start() {
let executor = WeechatExecutor::new();
#[allow(static_mut_refs)]
unsafe {
_EXECUTOR = Some(executor);
}
Expand All @@ -161,6 +163,7 @@ impl WeechatExecutor {
where
F: Future<Output = ()> + Send + 'static,
{
#[allow(static_mut_refs)]
let executor = unsafe { _EXECUTOR.as_ref().expect("Executor wasn't started") };

let future = Box::pin(future);
Expand All @@ -180,6 +183,7 @@ impl WeechatExecutor {
F: Future + 'static,
F::Output: 'static,
{
#[allow(static_mut_refs)]
let executor = unsafe { _EXECUTOR.as_ref() };
executor.map(|executor| executor.spawn_local(future))
}
Expand All @@ -189,6 +193,7 @@ impl WeechatExecutor {
F: Future + 'static,
F::Output: 'static,
{
#[allow(static_mut_refs)]
let executor = unsafe { _EXECUTOR.as_ref().expect("Executor wasn't started") };

let sender = Arc::downgrade(&executor.sender);
Expand Down

0 comments on commit 7f428b2

Please sign in to comment.