Skip to content

Commit

Permalink
bindings/rust/build.rs: resolve clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Jul 3, 2024
1 parent e40e91c commit 7d782b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bindings/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unexpected_cfgs)]

extern crate alloc;

Expand Down Expand Up @@ -39,12 +40,11 @@ mod mt {

pub fn da_pool() -> ThreadPool {
static INIT: Once = Once::new();
static mut POOL: *const Mutex<ThreadPool> =
0 as *const Mutex<ThreadPool>;
static mut POOL: *const Mutex<ThreadPool> = ptr::null();

INIT.call_once(|| {
let pool = Mutex::new(ThreadPool::default());
unsafe { POOL = transmute(Box::new(pool)) };
unsafe { POOL = transmute::<Box<_>, *const _>(Box::new(pool)) };
});
unsafe { (*POOL).lock().unwrap().clone() }
}
Expand Down

0 comments on commit 7d782b5

Please sign in to comment.