virtio-devices,vm-allocator: Fix clippy warnings

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam 2023-10-18 10:42:26 -07:00 committed by Rob Bradford
parent a1ce37c2af
commit 274f1aa2e7
2 changed files with 5 additions and 3 deletions

View File

@ -616,7 +616,9 @@ impl Block {
(disk_nsectors, avail_features, 0, config, false)
};
let serial = serial.map(Vec::from).unwrap_or(build_serial(&disk_path));
let serial = serial
.map(Vec::from)
.unwrap_or_else(|| build_serial(&disk_path));
Ok(Block {
common: VirtioCommon {

View File

@ -119,7 +119,7 @@ impl SystemAllocator {
self.platform_mmio_address_space.allocate(
address,
size,
Some(align_size.unwrap_or(get_page_size())),
Some(align_size.unwrap_or_else(get_page_size)),
)
}
@ -133,7 +133,7 @@ impl SystemAllocator {
self.mmio_hole_address_space.allocate(
address,
size,
Some(align_size.unwrap_or(get_page_size())),
Some(align_size.unwrap_or_else(get_page_size)),
)
}