mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
引入clippy,并根据clippy的提示,修改部分代码 (#575)
This commit is contained in:
@ -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;
|
||||
|
@ -2,6 +2,8 @@
|
||||
#![feature(const_for)]
|
||||
#![feature(const_mut_refs)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![allow(clippy::needless_return)]
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate std;
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
#![no_std]
|
||||
|
||||
#[allow(unused)]
|
||||
#[macro_use]
|
||||
pub extern crate thingbuf;
|
||||
|
||||
pub extern crate memoffset;
|
||||
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
#![no_std]
|
||||
#![allow(clippy::needless_return)]
|
||||
#![allow(clippy::upper_case_acronyms)]
|
||||
|
||||
use num_derive::{FromPrimitive, ToPrimitive};
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#![no_std]
|
||||
#![allow(clippy::needless_return)]
|
||||
|
||||
use system_error::SystemError;
|
||||
pub use unified_init_macros as macros;
|
||||
|
Reference in New Issue
Block a user