mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 03:12:27 +00:00
devices: rtc_pl031: Don't use manual range check
error: manual `Range::contains` implementation Error: --> devices/src/legacy/rtc_pl031.rs:342:12 | 342 | if offset < AMBA_ID_HIGH && offset >= AMBA_ID_LOW { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(AMBA_ID_LOW..AMBA_ID_HIGH).contains(&offset)` | = 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
fabd63072b
commit
3ad94ddf7c
@ -339,7 +339,7 @@ impl BusDevice for RTC {
|
||||
let v;
|
||||
let mut read_ok = true;
|
||||
|
||||
if offset < AMBA_ID_HIGH && offset >= AMBA_ID_LOW {
|
||||
if (AMBA_ID_LOW..AMBA_ID_HIGH).contains(&offset) {
|
||||
let index = ((offset - AMBA_ID_LOW) >> 2) as usize;
|
||||
v = u32::from(PL031_ID[index]);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user