Apply more Clippy rules (#505)

This commit is contained in:
Yota Toyama
2025-12-14 23:16:09 -08:00
committed by GitHub
parent 9601345035
commit 667bba4e3c
3 changed files with 10 additions and 3 deletions

View File

@@ -15,3 +15,10 @@ cmake = { version = "0.1.55", optional = true }
[features] [features]
default = ["autotools"] default = ["autotools"]
[lints.clippy]
alloc_instead_of_core = "deny"
dbg_macro = "deny"
missing_const_for_fn = "deny"
std_instead_of_alloc = "deny"
std_instead_of_core = "deny"

View File

@@ -1,4 +1,4 @@
use std::{ use core::{
error, error,
fmt::{self, Display, Formatter}, fmt::{self, Display, Formatter},
}; };
@@ -9,7 +9,7 @@ pub struct Error {
} }
impl Error { impl Error {
pub fn new(description: &'static str) -> Error { pub const fn new(description: &'static str) -> Error {
Error { description } Error { description }
} }
} }

View File

@@ -4,7 +4,7 @@ extern crate alloc;
mod error; mod error;
use alloc::alloc::{GlobalAlloc, Layout}; use core::alloc::{GlobalAlloc, Layout};
use core::ptr::null; use core::ptr::null;
use libc::{c_int, c_void, size_t}; use libc::{c_int, c_void, size_t};