mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
pci, ch-remote, vmm: Replace simple match blocks with matches!
This is a new clippy check introduced in 1.47 which requires the use of the matches!() macro for simple match blocks that return a boolean. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
2fac41f154
commit
bb5b9584d2
@ -714,20 +714,17 @@ impl PciDevice for VfioPciDevice {
|
||||
|
||||
// Is this an IO BAR?
|
||||
let io_bar = if bar_id != VFIO_PCI_ROM_REGION_INDEX {
|
||||
match lsb_flag & PCI_CONFIG_IO_BAR {
|
||||
PCI_CONFIG_IO_BAR => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(lsb_flag & PCI_CONFIG_IO_BAR, PCI_CONFIG_IO_BAR)
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
// Is this a 64-bit BAR?
|
||||
let is_64bit_bar = if bar_id != VFIO_PCI_ROM_REGION_INDEX {
|
||||
match lsb_flag & PCI_CONFIG_MEMORY_BAR_64BIT {
|
||||
PCI_CONFIG_MEMORY_BAR_64BIT => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(
|
||||
lsb_flag & PCI_CONFIG_MEMORY_BAR_64BIT,
|
||||
PCI_CONFIG_MEMORY_BAR_64BIT
|
||||
)
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
@ -96,10 +96,10 @@ impl StatusCode {
|
||||
}
|
||||
|
||||
fn is_server_error(self) -> bool {
|
||||
match self {
|
||||
StatusCode::OK | StatusCode::Continue | StatusCode::NoContent => false,
|
||||
_ => true,
|
||||
}
|
||||
!matches!(
|
||||
self,
|
||||
StatusCode::OK | StatusCode::Continue | StatusCode::NoContent
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1088,10 +1088,7 @@ pub enum ConsoleOutputMode {
|
||||
|
||||
impl ConsoleOutputMode {
|
||||
pub fn input_enabled(&self) -> bool {
|
||||
match self {
|
||||
ConsoleOutputMode::Tty => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, ConsoleOutputMode::Tty)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user