From e4f85a2b69caa6bbacfe80adf070672624dbf7dd Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 23 Jan 2025 11:33:44 -0800 Subject: [PATCH] [clippy] replace match with question mark operator Change-Id: I1288b3da28cc4e4cc289b34daf3ce02180d38d62 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6195241 Reviewed-by: Dennis Kempin Commit-Queue: Daniel Verkamp --- resources/src/system_allocator.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/src/system_allocator.rs b/resources/src/system_allocator.rs index 78ade48d7..2faae4f7a 100644 --- a/resources/src/system_allocator.rs +++ b/resources/src/system_allocator.rs @@ -305,10 +305,7 @@ impl SystemAllocator { /// Allocate PCI slot location. pub fn allocate_pci(&mut self, bus: u8, tag: String) -> Option { let id = self.get_anon_alloc(); - let allocator = match self.get_pci_allocator_mut(bus) { - Some(v) => v, - None => return None, - }; + let allocator = self.get_pci_allocator_mut(bus)?; allocator .allocate(1, id, tag) .map(|v| PciAddress {