diff --git a/src/executor/network.rs b/src/executor/network.rs index ea2bab31c4..1c07d97aa6 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)); } diff --git a/src/syscalls/socket.rs b/src/syscalls/socket.rs index 5993b6a3bb..2552268d7b 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::<in_addr>().try_into().unwrap() - && len != size_of::<in6_addr>().try_into().unwrap() - { + if len != size_of::<in_addr>() && len != size_of::<in6_addr>() { return -EINVAL; } @@ -375,7 +373,7 @@ pub unsafe extern "C" fn sys_getaddrbyname( return -EINVAL; } - let query_type = if len == size_of::<in6_addr>().try_into().unwrap() { + let query_type = if len == size_of::<in6_addr>() { DnsQueryType::Aaaa } else { DnsQueryType::A 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()?;