From b3ca672f70c71194da40a7670549a8264c13d971 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 12 Jan 2024 20:24:51 +0100 Subject: Update to `embedded-hal` 1.0. --- src/conversion.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/conversion.rs') diff --git a/src/conversion.rs b/src/conversion.rs index d6aea82..142de0e 100644 --- a/src/conversion.rs +++ b/src/conversion.rs @@ -7,7 +7,7 @@ pub trait ConvertThreshold: private::Sealed { impl ConvertThreshold for ic::Resolution12Bit { fn convert_threshold(value: i16) -> Result> { - if value < -2048 || value > 2047 { + if !(-2048..=2047).contains(&value) { return Err(Error::InvalidInputData); } Ok((value << 4) as u16) -- cgit v1.2.3-54-g00ecf