diff --git a/pci/src/vfio.rs b/pci/src/vfio.rs index 283b40fda..5e18660c3 100644 --- a/pci/src/vfio.rs +++ b/pci/src/vfio.rs @@ -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 }; diff --git a/src/bin/ch-remote.rs b/src/bin/ch-remote.rs index 230e9f61b..3da594a8a 100644 --- a/src/bin/ch-remote.rs +++ b/src/bin/ch-remote.rs @@ -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 + ) } } diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 655ff753d..646e62263 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -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) } }