mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Remove manual implementation of is_power_of_two
As clippy of rust-toolchain version 1.83.0-beta.1 suggests, remove manual implementation of `is_power_of_two` to improve readability. Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
@@ -178,7 +178,7 @@ pub mod testing {
|
||||
// We try to make sure things are aligned properly :-s
|
||||
pub fn new(start: GuestAddress, mem: &'a GuestMemoryMmap, qsize: u16) -> Self {
|
||||
// power of 2?
|
||||
assert!(qsize > 0 && qsize & (qsize - 1) == 0);
|
||||
assert!(qsize.is_power_of_two());
|
||||
|
||||
let mut dtable = Vec::with_capacity(qsize as usize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user