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/devices/common.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/devices/common.rs') diff --git a/src/devices/common.rs b/src/devices/common.rs index 2234d93..f1509d3 100644 --- a/src/devices/common.rs +++ b/src/devices/common.rs @@ -7,11 +7,10 @@ where DI: interface::WriteData + interface::ReadData, { pub(super) fn set_operating_mode(&mut self, mode: OperatingMode) -> Result<(), Error> { - let config; - match mode { - OperatingMode::OneShot => config = self.config.with_high(BitFlags::OP_MODE), - OperatingMode::Continuous => config = self.config.with_low(BitFlags::OP_MODE), - } + let config = match mode { + OperatingMode::OneShot => self.config.with_high(BitFlags::OP_MODE), + OperatingMode::Continuous => self.config.with_low(BitFlags::OP_MODE), + }; self.iface.write_register(Register::CONFIG, config.bits)?; self.config = config; Ok(()) -- cgit v1.2.3-54-g00ecf