cloud-hypervisor/vm-allocator/src
Jinank Jain b686a5bb24 vm-allocator: Fix clippy warning for implicit saturating sub
Use the builtin function to improve the readability of the code.

Warning from beta compiler:

error: manual arithmetic check found
--> vm-allocator/src/address.rs:151:30
|
|let adjust = if alignment > 1 { alignment - 1 } else { 0 };
|             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|             help: replace it with: `alignment.saturating_sub(1)`
|
= help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
= note: `-D clippy::implicit-saturating-sub` implied by `-D warnings`
= help: to override `-D warnings` add`#[allow(clippy::implicit_saturating_sub)]`

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
2025-04-03 13:11:49 +00:00
..
address.rs vm-allocator: Fix clippy warning for implicit saturating sub 2025-04-03 13:11:49 +00:00
gsi.rs vm-allocator: Introduce RISC-V architecture 2024-12-04 09:29:56 +00:00
lib.rs vm-allocator: Add an allocator KVM memory slots 2024-11-24 10:45:15 +00:00
memory_slot.rs vm-allocator: Add an allocator KVM memory slots 2024-11-24 10:45:15 +00:00
page_size.rs vm-allocator: Add page size related functions 2023-06-19 10:29:23 +08:00
system.rs vmm: support PCI I/O regions on all architectures 2024-12-14 14:12:00 +00:00