mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
virtio-devices: use Option::map
It's more concise, more idiomatic Rust, and satisfies nightly clippy. Signed-off-by: Gaelan Steele <gbs@canishe.com>
This commit is contained in:
parent
d72d7fd93c
commit
b16fdb1b3a
@ -538,11 +538,7 @@ impl VirtioDevice for Fs {
|
||||
}
|
||||
|
||||
fn get_shm_regions(&self) -> Option<VirtioSharedMemoryList> {
|
||||
if let Some(cache) = self.cache.as_ref() {
|
||||
Some(cache.0.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
self.cache.as_ref().map(|cache| cache.0.clone())
|
||||
}
|
||||
|
||||
fn set_shm_regions(
|
||||
|
Loading…
x
Reference in New Issue
Block a user