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

@ -18,6 +18,7 @@ pub struct PanicContext {
}
impl PanicContext {
#[allow(clippy::print_stderr)]
fn init() {
let default_hook = panic::take_hook();
let hook = move |panic_info: &panic::PanicInfo<'_>| {
@ -43,7 +44,7 @@ impl Drop for PanicContext {
fn with_ctx(f: impl FnOnce(&mut Vec<String>)) {
thread_local! {
static CTX: RefCell<Vec<String>> = RefCell::new(Vec::new());
static CTX: RefCell<Vec<String>> = const { RefCell::new(Vec::new()) };
}
CTX.with(|ctx| f(&mut ctx.borrow_mut()));
}