From 4adf635bf5eebd14b667c0745350bdd46191f1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Tue, 3 Dec 2024 14:45:40 +0100 Subject: [PATCH 1/3] fix(dns): `clippy::len_zero` --- src/executor/network.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/executor/network.rs b/src/executor/network.rs index 5bc91433ec..911650ae1e 100644 --- a/src/executor/network.rs +++ b/src/executor/network.rs @@ -138,7 +138,7 @@ async fn dhcpv4_run() { } #[cfg(feature = "dns")] - if dns_servers.len() > 0 { + if !dns_servers.is_empty() { let dns_socket = dns::Socket::new(dns_servers.as_slice(), vec![]); nic.dns_handle = Some(nic.sockets.add(dns_socket)); } From aba621db85755b65ded8a8f421553e3fdf8990b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Tue, 3 Dec 2024 14:46:53 +0100 Subject: [PATCH 2/3] fix(dns): `clippy::useless_conversion` --- src/syscalls/socket.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/syscalls/socket.rs b/src/syscalls/socket.rs index 15d175c4e6..8d47dda706 100644 --- a/src/syscalls/socket.rs +++ b/src/syscalls/socket.rs @@ -365,9 +365,7 @@ pub unsafe extern "C" fn sys_getaddrbyname( use crate::executor::block_on; use crate::executor::network::get_query_result; - if len != size_of::().try_into().unwrap() - && len != size_of::().try_into().unwrap() - { + if len != size_of::() && len != size_of::() { return -EINVAL; } @@ -375,7 +373,7 @@ pub unsafe extern "C" fn sys_getaddrbyname( return -EINVAL; } - let query_type = if len == size_of::().try_into().unwrap() { + let query_type = if len == size_of::() { DnsQueryType::Aaaa } else { DnsQueryType::A From 22476ead9d47f229df7ae2d0035fa2c24b1f9c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Tue, 3 Dec 2024 14:47:51 +0100 Subject: [PATCH 3/3] fix(xtask): run clippy on `feature = "dns"` --- xtask/src/clippy.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xtask/src/clippy.rs b/xtask/src/clippy.rs index 2633e98c56..b13bb208c6 100644 --- a/xtask/src/clippy.rs +++ b/xtask/src/clippy.rs @@ -17,6 +17,9 @@ impl Clippy { let triple = arch.triple(); cmd!(sh, "cargo clippy --target={triple}").run()?; + cmd!(sh, "cargo clippy --target={triple}") + .arg("--features=acpi,dns,fsgsbase,pci,shell,smp,vga") + .run()?; cmd!(sh, "cargo clippy --target={triple}") .arg("--no-default-features") .run()?;