chore: logging: make clippy happy

This commit is contained in:
Paul Pan 2024-06-16 22:29:58 +08:00
parent 78133158b6
commit d8c1ba45ed

View File

@ -9,7 +9,7 @@ use log::{LevelFilter, Log, Metadata, Record};
macro_rules! print {
($($arg:tt)*) => {{
use core::fmt::Write;
use crate::plat::console::CONSOLE;
use $crate::plat::console::CONSOLE;
CONSOLE.lock().write_fmt(format_args!($($arg)*)).unwrap();
}};
}
@ -73,8 +73,7 @@ pub fn set_log_level(fdt: &Fdt) {
.map(|args| args.split_ascii_whitespace())
.map(|args| args.filter(|arg| arg.starts_with("loglevel=")))
.map(|args| args.map(|arg| arg["loglevel=".len()..].parse::<usize>()))
.map(|args| args.last())
.flatten()
.and_then(|args| args.last())
.map(|level| level.unwrap_or(UNKNOWN_LEVEL))
.unwrap_or(UNKNOWN_LEVEL);