diff options
Diffstat (limited to 'src/conversion.rs')
-rw-r--r-- | src/conversion.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<E>: private::Sealed { impl<E> ConvertThreshold<E> for ic::Resolution12Bit { fn convert_threshold(value: i16) -> Result<u16, Error<E>> { - if value < -2048 || value > 2047 { + if !(-2048..=2047).contains(&value) { return Err(Error::InvalidInputData); } Ok((value << 4) as u16) |