From a3171010c8dea328cfc380871d22f7a5d2c2fd5b Mon Sep 17 00:00:00 2001 From: Richard Meadows <962920+richardeoin@users.noreply.github.com> Date: Sun, 3 Mar 2024 18:20:00 +0100 Subject: [PATCH] Tidy redundant imports `TryFrom` and `TryInto` part of the prelude [since the 2021 edition](https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html). https://github.com/stm32-rs/stm32h7xx-hal/pull/236 --- examples/usb_phy_serial_interrupt.rs | 6 ++++-- src/crc.rs | 1 - src/ethernet/eth.rs | 1 - src/sai/i2s.rs | 1 - src/sai/pdm.rs | 2 -- src/spi.rs | 1 - src/timer.rs | 1 - 7 files changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/usb_phy_serial_interrupt.rs b/examples/usb_phy_serial_interrupt.rs index 88b7d891..90b2533a 100644 --- a/examples/usb_phy_serial_interrupt.rs +++ b/examples/usb_phy_serial_interrupt.rs @@ -18,8 +18,10 @@ use { stm32, usb_hs::{UsbBus, USB1_ULPI}, }, - usb_device::prelude::*, - usb_device::{bus::UsbBusAllocator, device::UsbDevice}, + usb_device::{ + bus::UsbBusAllocator, + device::{UsbDevice, UsbDeviceBuilder, UsbVidPid}, + }, usbd_serial::{DefaultBufferStore, SerialPort}, }; diff --git a/src/crc.rs b/src/crc.rs index 5319e716..41af5e96 100644 --- a/src/crc.rs +++ b/src/crc.rs @@ -4,7 +4,6 @@ //! //! - [CRC example](https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/crc.rs) -use core::convert::TryInto; use core::fmt; use crate::rcc::{rec, ResetEnable}; diff --git a/src/ethernet/eth.rs b/src/ethernet/eth.rs index d786dac0..b825595b 100644 --- a/src/ethernet/eth.rs +++ b/src/ethernet/eth.rs @@ -28,7 +28,6 @@ use crate::rcc::{rec, CoreClocks, ResetEnable}; use crate::stm32; use smoltcp::{ - self, phy::{self, DeviceCapabilities}, time::Instant, wire::EthernetAddress, diff --git a/src/sai/i2s.rs b/src/sai/i2s.rs index 794bde7f..d06735a5 100644 --- a/src/sai/i2s.rs +++ b/src/sai/i2s.rs @@ -2,7 +2,6 @@ //! //! Inter-IC Sound. //! -use core::convert::TryInto; use crate::rcc::{rec, CoreClocks, ResetEnable}; use crate::sai::{GetClkSAI, Sai, SaiChannel, CLEAR_ALL_FLAGS_BITS, INTERFACE}; diff --git a/src/sai/pdm.rs b/src/sai/pdm.rs index 3bb19158..2135335a 100644 --- a/src/sai/pdm.rs +++ b/src/sai/pdm.rs @@ -15,8 +15,6 @@ //! let _ = block!(sai.read_data()).unwrap(); //! ``` -use core::convert::TryInto; - use crate::rcc::{rec, CoreClocks, ResetEnable}; use crate::sai::{GetClkSAI, Sai, SaiChannel, INTERFACE}; diff --git a/src/spi.rs b/src/spi.rs index 3247a0e2..9754c038 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -63,7 +63,6 @@ //! [embedded_hal]: https://docs.rs/embedded-hal/0.2.3/embedded_hal/spi/index.html use core::cell::UnsafeCell; -use core::convert::From; use core::marker::PhantomData; use core::ptr; diff --git a/src/timer.rs b/src/timer.rs index bd525cf5..06d881d0 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -8,7 +8,6 @@ // TODO: on the h7x3 at least, only TIM2, TIM3, TIM4, TIM5 can support 32 bits. // TIM1 is 16 bit. -use core::convert::TryFrom; use core::marker::PhantomData; use crate::hal::timer::{CountDown, Periodic};