Lint debug prints and disallowed types with clippy

This commit is contained in:
Lukas Wirth 2024-02-01 16:16:38 +01:00
parent 850ba2fb63
commit 9e8a0fae0c
64 changed files with 170 additions and 229 deletions

View file

@ -21,7 +21,7 @@ pub use countme;
/// almost zero.
pub use countme::Count;
thread_local!(static IN_SCOPE: RefCell<bool> = RefCell::new(false));
thread_local!(static IN_SCOPE: RefCell<bool> = const { RefCell::new(false) });
/// Allows to check if the current code is within some dynamic scope, can be
/// useful during debugging to figure out why a function is called.
@ -88,6 +88,7 @@ pub fn cpu_span() -> CpuSpan {
}
#[cfg(not(feature = "cpu_profiler"))]
#[allow(clippy::print_stderr)]
{
eprintln!(
r#"cpu profiling is disabled, uncomment `default = [ "cpu_profiler" ]` in Cargo.toml to enable."#

View file

@ -1,4 +1,7 @@
//! Like `std::time::Instant`, but also measures memory & CPU cycles.
#![allow(clippy::print_stderr)]
use std::{
fmt,
time::{Duration, Instant},