From 3ad94ddf7cfeec9268d6fa86bdf3f588296d4a77 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Sat, 2 Jan 2021 21:46:28 +0000 Subject: [PATCH] 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 --- devices/src/legacy/rtc_pl031.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/src/legacy/rtc_pl031.rs b/devices/src/legacy/rtc_pl031.rs index e5a88e45c..2793642e8 100644 --- a/devices/src/legacy/rtc_pl031.rs +++ b/devices/src/legacy/rtc_pl031.rs @@ -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 {