mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
build: treewide: clippy: collapse nested ifs, use let chains
This bumps the MSRV to 1.88 (also, Rust edition 2024 is mandatory). Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Bo Chen
parent
f73a6c8d8e
commit
c995b72384
@@ -437,10 +437,10 @@ impl VsockMuxer {
|
||||
if let Some(EpollListener::LocalStream(stream)) = self.listener_map.get_mut(&fd) {
|
||||
let port = Self::read_local_stream_port(&mut self.partial_command_map, stream);
|
||||
|
||||
if let Err(Error::UnixRead(ref e)) = port {
|
||||
if e.kind() == ErrorKind::WouldBlock {
|
||||
return;
|
||||
}
|
||||
if let Err(Error::UnixRead(ref e)) = port
|
||||
&& e.kind() == ErrorKind::WouldBlock
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
let stream = match self.remove_listener(fd) {
|
||||
|
||||
@@ -111,11 +111,12 @@ impl MuxerKillQ {
|
||||
/// the queue has expired. Otherwise, `None` is returned.
|
||||
///
|
||||
pub fn pop(&mut self) -> Option<ConnMapKey> {
|
||||
if let Some(item) = self.q.front() {
|
||||
if Instant::now() > item.kill_time {
|
||||
return Some(self.q.pop_front().unwrap().key);
|
||||
}
|
||||
if let Some(item) = self.q.front()
|
||||
&& Instant::now() > item.kill_time
|
||||
{
|
||||
return Some(self.q.pop_front().unwrap().key);
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user