1
0
mirror of https://github.com/bspeice/qadapt synced 2025-07-03 06:45:02 -04:00

Fix up the clippy warnings

This commit is contained in:
2018-12-06 22:14:43 -05:00
parent f4f33dabb7
commit a1ee8934b4
5 changed files with 3 additions and 12 deletions

View File

@ -12,10 +12,7 @@
//! for some helper macros to make working with QADAPT a bit easier.
#![deny(missing_docs)]
#[macro_use]
extern crate log;
use log::warn;
// thread_id is necessary because `std::thread::current()` panics if we have not yet
// allocated a `thread_local!{}` it depends on.
use thread_id;
@ -47,7 +44,7 @@ pub fn enter_protected() {
return;
}
if *IS_ACTIVE.read() == false {
if !*IS_ACTIVE.read() {
*IS_ACTIVE.write() = true;
warn!("QADAPT not initialized when using allocation guards; please verify `#[global_allocator]` is set!");
}
@ -123,7 +120,7 @@ fn alloc_immediate() -> bool {
unsafe impl GlobalAlloc for QADAPT {
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
if *IS_ACTIVE.read() == false {
if !*IS_ACTIVE.read() {
*IS_ACTIVE.write() = true;
}