mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 11:22:26 +00:00
qcow: Use .contains() for range check
error: manual `!RangeInclusive::contains` implementation --> qcow/src/qcow.rs:412:12 | 412 | if cluster_bits < MIN_CLUSTER_BITS || cluster_bits > MAX_CLUSTER_BITS { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(MIN_CLUSTER_BITS..=MAX_CLUSTER_BITS).contains(&cluster_bits)` | = note: `-D clippy::manual-range-contains` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
9f2e7f455f
commit
d2de263774
@ -409,7 +409,7 @@ impl QcowFile {
|
||||
}
|
||||
|
||||
let cluster_bits: u32 = header.cluster_bits;
|
||||
if cluster_bits < MIN_CLUSTER_BITS || cluster_bits > MAX_CLUSTER_BITS {
|
||||
if !(MIN_CLUSTER_BITS..=MAX_CLUSTER_BITS).contains(&cluster_bits) {
|
||||
return Err(Error::InvalidClusterSize);
|
||||
}
|
||||
let cluster_size = 0x01u64 << cluster_bits;
|
||||
|
Loading…
x
Reference in New Issue
Block a user