引入clippy,并根据clippy的提示,修改部分代码 (#575)

This commit is contained in:
LoGin
2024-03-10 21:45:34 +08:00
committed by GitHub
parent f4a82aa55c
commit 840045af94
26 changed files with 77 additions and 81 deletions

View File

@ -2,6 +2,7 @@
#![feature(core_intrinsics)]
#![allow(incomplete_features)] // for const generics
#![feature(generic_const_exprs)]
#![allow(clippy::needless_return)]
#[macro_use]
extern crate alloc;

View File

@ -2,6 +2,8 @@
#![feature(const_for)]
#![feature(const_mut_refs)]
#![feature(const_trait_impl)]
#![allow(clippy::needless_return)]
#[cfg(test)]
extern crate std;

View File

@ -1,7 +1,5 @@
#![no_std]
#[allow(unused)]
#[macro_use]
pub extern crate thingbuf;
pub extern crate memoffset;

View File

@ -1,6 +1,7 @@
#![no_std]
#![feature(const_refs_to_cell)]
#![feature(const_size_of_val)]
#![allow(clippy::needless_return)]
extern crate alloc;
use core::{fmt::Debug, mem::size_of_val};
@ -88,7 +89,7 @@ impl AllocatorLog {
/// 当前日志是否有效
pub fn is_valid(&self) -> bool {
if self.validate_checksum() == false {
if !self.validate_checksum() {
return false;
}
@ -102,7 +103,7 @@ impl AllocatorLog {
impl PartialOrd for AllocatorLog {
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
return self.id.partial_cmp(&other.id);
Some(self.cmp(other))
}
}

View File

@ -1,4 +1,6 @@
#![no_std]
#![allow(clippy::needless_return)]
#![allow(clippy::upper_case_acronyms)]
use num_derive::{FromPrimitive, ToPrimitive};

View File

@ -1,4 +1,5 @@
#![no_std]
#![allow(clippy::needless_return)]
use system_error::SystemError;
pub use unified_init_macros as macros;