mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Fix various clippy issues
Assisted-by: Claude:Opus-4.7 Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user