diff --git a/src/hardware/adc.rs b/src/hardware/adc.rs index 8919479..26752f7 100644 --- a/src/hardware/adc.rs +++ b/src/hardware/adc.rs @@ -81,6 +81,7 @@ use hal::dma::{ #[derive(Copy, Clone)] pub struct AdcCode(pub u16); +#[allow(clippy::from_over_into)] impl Into for AdcCode { /// Convert raw ADC codes to/from voltage levels. /// diff --git a/src/hardware/dac.rs b/src/hardware/dac.rs index 013c43a..9b42e37 100644 --- a/src/hardware/dac.rs +++ b/src/hardware/dac.rs @@ -73,6 +73,7 @@ static mut DAC_BUF: [[SampleBuffer; 2]; 2] = [[[0; SAMPLE_BUFFER_SIZE]; 2]; 2]; #[derive(Copy, Clone)] pub struct DacCode(pub u16); +#[allow(clippy::from_over_into)] impl Into for DacCode { fn into(self) -> f32 { // The DAC output range in bipolar mode (including the external output op-amp) is +/- 4.096 @@ -104,7 +105,7 @@ macro_rules! dac_output { _channel: timers::tim2::$trigger_channel, spi: hal::spi::Spi, ) -> Self { - Self { _channel, spi } + Self { spi, _channel } } /// Start the SPI and begin operating in a DMA-driven transfer mode. diff --git a/src/net/miniconf_client.rs b/src/net/miniconf_client.rs index e5f328a..f280318 100644 --- a/src/net/miniconf_client.rs +++ b/src/net/miniconf_client.rs @@ -103,7 +103,7 @@ where let path = match topic.strip_prefix(prefix) { // For paths, we do not want to include the leading slash. Some(path) => { - if path.len() > 0 { + if !path.is_empty() { &path[1..] } else { path @@ -117,9 +117,9 @@ where let message: SettingsResponse = settings .string_set(path.split('/').peekable(), message) - .and_then(|_| { + .map(|_| { update = true; - Ok(()) + () }) .into();