misc: Fix various clippy issues

Assisted-by: Claude:Opus-4.7
Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
Bo Chen
2026-05-14 20:16:49 +00:00
committed by Bo Chen
parent e2cd6ff8c9
commit 3453eb6e86
7 changed files with 84 additions and 94 deletions

View File

@@ -407,9 +407,11 @@ impl VsockMuxer {
Some(EpollListener::HostSock) => {
if self.conn_map.len() == defs::MAX_CONNECTIONS {
// If we're already maxed-out on connections, we'll just accept and
// immediately discard this potentially new one.
// immediately discard this potentially new one. Dropping the returned
// `UnixStream` closes the new connection; we don't care if `accept()`
// itself failed.
warn!("vsock: connection limit reached; refusing new host connection");
self.host_sock.accept().map(|_| 0).unwrap_or(0);
let _ = self.host_sock.accept();
return;
}
self.host_sock

View File

@@ -110,6 +110,10 @@ impl MuxerKillQ {
/// This will succeed and return a connection key, only if the connection at the front of
/// the queue has expired. Otherwise, `None` is returned.
///
// `VecDeque::pop_front_if` is unstable on the project MSRV; allow the
// beta clippy lint that asks for it. `unknown_lints` is needed because
// the lint does not exist on stable clippy.
#[allow(unknown_lints, clippy::manual_pop_if)]
pub fn pop(&mut self) -> Option<ConnMapKey> {
if let Some(item) = self.q.front()
&& Instant::now() > item.kill_time