Skip to content

Commit 27a5f57

Browse files
calebbourgjhodapp
authored andcommitted
simplify imports
1 parent c39c71d commit 27a5f57

File tree

5 files changed

+25
-31
lines changed

5 files changed

+25
-31
lines changed

esp32-wroom-rp/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,19 @@
149149
#![warn(missing_docs)]
150150
#![cfg_attr(not(test), no_std)]
151151

152-
pub mod tcp_client;
153152
pub mod gpio;
154-
pub mod wifi;
155153
pub mod network;
156154
pub mod protocol;
155+
pub mod tcp_client;
156+
pub mod wifi;
157157

158158
mod spi;
159159

160+
use defmt::{write, Format, Formatter};
161+
160162
use network::NetworkError;
161163
use protocol::ProtocolError;
162164

163-
use defmt::{write, Format, Formatter};
164-
165165
const ARRAY_LENGTH_PLACEHOLDER: usize = 8;
166166

167167
/// Highest level error types for this crate.

esp32-wroom-rp/src/protocol/operation.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use heapless::Vec;
2+
13
use crate::protocol::{NinaAbstractParam, NinaCommand};
24

3-
use heapless::Vec;
45
const MAX_NUMBER_OF_PARAMS: usize = 6;
56

67
// Encapsulates all information needed to execute commands against Nina Firmware.

esp32-wroom-rp/src/spi.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
//! Serial Peripheral Interface (SPI) for Wifi
2+
use core::convert::Infallible;
23

3-
use crate::network::ConnectionState;
4+
use embedded_hal::blocking::delay::DelayMs;
5+
use embedded_hal::blocking::spi::Transfer;
46

57
use super::gpio::EspControlInterface;
8+
use super::network::{ConnectionState, IpAddress, NetworkError, Port, Socket, TransportMode};
9+
use super::protocol::operation::Operation;
610
use super::protocol::{
711
NinaByteParam, NinaCommand, NinaConcreteParam, NinaLargeArrayParam, NinaParam,
8-
NinaProtocolHandler, NinaSmallArrayParam, NinaWordParam, ProtocolInterface,
12+
NinaProtocolHandler, NinaSmallArrayParam, NinaWordParam, ProtocolError, ProtocolInterface,
913
};
10-
11-
use super::network::{IpAddress, NetworkError, Port, Socket, TransportMode};
12-
use super::protocol::{operation::Operation, ProtocolError};
1314
use super::wifi::ConnectionStatus;
1415
use super::{Error, FirmwareVersion, ARRAY_LENGTH_PLACEHOLDER};
1516

16-
use embedded_hal::blocking::delay::DelayMs;
17-
use embedded_hal::blocking::spi::Transfer;
18-
19-
use core::convert::Infallible;
20-
2117
// TODO: this should eventually move into NinaCommandHandler
2218
#[repr(u8)]
2319
#[derive(Debug)]

esp32-wroom-rp/src/tcp_client.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@
66
//! ```
77
//!
88
9-
use super::{Error, ARRAY_LENGTH_PLACEHOLDER};
10-
use crate::{network::NetworkError, wifi::Wifi};
11-
12-
use super::protocol::NinaProtocolHandler;
13-
use crate::gpio::EspControlInterface;
14-
use crate::protocol::ProtocolInterface;
15-
16-
use super::network::{ConnectionState, Hostname, IpAddress, Port, Socket, TransportMode};
17-
189
use embedded_hal::blocking::delay::DelayMs;
1910
use embedded_hal::blocking::spi::Transfer;
2011

2112
use heapless::String;
2213

14+
use super::gpio::EspControlInterface;
15+
use super::network::{
16+
ConnectionState, Hostname, IpAddress, NetworkError, Port, Socket, TransportMode,
17+
};
18+
use super::protocol::{NinaProtocolHandler, ProtocolInterface};
19+
use super::wifi::Wifi;
20+
use super::{Error, ARRAY_LENGTH_PLACEHOLDER};
21+
2322
const MAX_HOSTNAME_LENGTH: usize = 255;
2423

2524
/// Connect trait that allows for a `TcpClient` instance to connect to a remote

esp32-wroom-rp/src/wifi.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@
66
//! ```
77
//!
88
9-
use embedded_hal::blocking::delay::DelayMs;
10-
use embedded_hal::blocking::spi::Transfer;
9+
use core::cell::RefCell;
1110

1211
use defmt::{write, Format, Formatter};
1312

14-
use super::{Error, FirmwareVersion};
13+
use embedded_hal::blocking::delay::DelayMs;
14+
use embedded_hal::blocking::spi::Transfer;
1515

1616
use super::gpio::EspControlInterface;
17-
use super::protocol::{NinaProtocolHandler, ProtocolInterface};
18-
19-
use core::cell::RefCell;
20-
2117
use super::network::IpAddress;
18+
use super::protocol::{NinaProtocolHandler, ProtocolInterface};
19+
use super::{Error, FirmwareVersion};
2220

2321
/// An enumerated type that represents the current WiFi network connection status.
2422
#[repr(u8)]

0 commit comments

Comments
 (0)