From af743e6dac881cf29eb147758c3ecf3abe1f01a0 Mon Sep 17 00:00:00 2001 From: dimi Date: Tue, 26 Mar 2024 20:15:39 +0100 Subject: [PATCH] fix CI warnings --- .cargo/{config => config.toml} | 0 CHANGELOG.md | 1 + examples/dac.rs | 1 - examples/pwm_complementary.rs | 1 - examples/usb_serial.rs | 6 +++--- src/gpio.rs | 2 +- src/signature.rs | 4 +--- 7 files changed, 6 insertions(+), 9 deletions(-) rename .cargo/{config => config.toml} (100%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index d5ba3d8e..1e4c3a97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `invalid_reference_casting` Compilation error in spi.rs for Rust version 1.73+ ( See [PR#112431](https://github.com/rust-lang/rust/pull/112431) for more info) - `unused_doc_comments` Warning in rcc.rs +- Fixed some warnings #177 ## [v0.18.0] - 2021-11-14 diff --git a/examples/dac.rs b/examples/dac.rs index 999ee1d5..6ba0d234 100644 --- a/examples/dac.rs +++ b/examples/dac.rs @@ -2,7 +2,6 @@ #![no_main] #![no_std] -use cortex_m; use cortex_m_rt as rt; use panic_halt as _; diff --git a/examples/pwm_complementary.rs b/examples/pwm_complementary.rs index 919f1e44..f190c209 100644 --- a/examples/pwm_complementary.rs +++ b/examples/pwm_complementary.rs @@ -5,7 +5,6 @@ // Halt on panic use panic_halt as _; -use cortex_m; use cortex_m_rt::entry; use stm32f0xx_hal as hal; diff --git a/examples/usb_serial.rs b/examples/usb_serial.rs index 1613fbdf..49afe553 100644 --- a/examples/usb_serial.rs +++ b/examples/usb_serial.rs @@ -36,7 +36,7 @@ fn main() -> ! { // Configure the on-board LED (LD3, green) let gpiob = dp.GPIOB.split(&mut rcc); let mut led = cortex_m::interrupt::free(|cs| gpiob.pb3.into_push_pull_output(cs)); - led.set_low(); // Turn off + led.set_low().ok(); // Turn off let gpioa = dp.GPIOA.split(&mut rcc); @@ -66,7 +66,7 @@ fn main() -> ! { match serial.read(&mut buf) { Ok(count) if count > 0 => { - led.set_high(); // Turn on + led.set_high().ok(); // Turn on // Echo back in upper case for c in buf[0..count].iter_mut() { @@ -88,6 +88,6 @@ fn main() -> ! { _ => {} } - led.set_low(); // Turn off + led.set_low().ok(); // Turn off } } diff --git a/src/gpio.rs b/src/gpio.rs index a5f7ae97..dd2757e9 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -758,4 +758,4 @@ gpio!([ PF9: (pf9, 9, Input), PF10: (pf10, 10, Input), ] - ]); +]); diff --git a/src/signature.rs b/src/signature.rs index b129e84e..5384e693 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -2,8 +2,6 @@ //! //! (stored in flash memory) -use core::str::from_utf8_unchecked; - /// This is the test voltage in millivolts of the calibration done at the factory pub const VDDA_CALIB: u32 = 3300; @@ -54,7 +52,7 @@ impl Uid { /// Lot number pub fn lot_num(&self) -> &str { - unsafe { from_utf8_unchecked(&self.waf_lot[1..]) } + unsafe { core::str::from_utf8_unchecked(&self.waf_lot[1..]) } } }