mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 23:41:15 +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> {
|
fn get_shm_regions(&self) -> Option<VirtioSharedMemoryList> {
|
||||||
if let Some(cache) = self.cache.as_ref() {
|
self.cache.as_ref().map(|cache| cache.0.clone())
|
||||||
Some(cache.0.clone())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_shm_regions(
|
fn set_shm_regions(
|
||||||
|
Loading…
Reference in New Issue
Block a user