Skip to content

Commit 3bf291c

Browse files
committed
Address all Clippy warnings for: "redundant field names in struct initialization."
1 parent e2b4418 commit 3bf291c

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

esp32-wroom-rp/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,16 @@ impl FirmwareVersion {
141141

142142
// Takes in 8 bytes (e.g. 1.7.4) and returns a FirmwareVersion instance
143143
fn parse(version: [u8; ARRAY_LENGTH_PLACEHOLDER]) -> FirmwareVersion {
144-
let major: u8;
145-
let minor: u8;
146-
let patch: u8;
144+
let major_version: u8;
145+
let minor_version: u8;
146+
let patch_version: u8;
147147

148-
[major, _, minor, _, patch, _, _, _] = version;
148+
[major_version, _, minor_version, _, patch_version, _, _, _] = version;
149149

150150
FirmwareVersion {
151-
major: major,
152-
minor: minor,
153-
patch: patch,
151+
major: major_version,
152+
minor: minor_version,
153+
patch: patch_version,
154154
}
155155
}
156156
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ impl<P> Operation<P> {
1717
// Initializes new Operation instance.
1818
//
1919
// `has_params` defaults to `true`
20-
pub fn new(command: NinaCommand, number_of_params_to_receive: u8) -> Self {
20+
pub fn new(nina_command: NinaCommand, number_of_nina_params_to_receive: u8) -> Self {
2121
Self {
2222
params: Vec::new(),
23-
command: command,
23+
command: nina_command,
2424
has_params: true,
25-
number_of_params_to_receive: number_of_params_to_receive,
25+
number_of_params_to_receive: number_of_nina_params_to_receive,
2626
}
2727
}
2828

esp32-wroom-rp/src/spi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ where
4444
/// Calling this function puts the connected ESP32-WROOM device in a known good state to accept commands.
4545
pub fn init<D: DelayMs<u16>>(
4646
spi: &'a mut S,
47-
control_pins: &'a mut C,
47+
esp32_control_pins: &'a mut C,
4848
delay: &mut D,
4949
) -> Result<Wifi<'a, S, C>, Error> {
5050
let mut wifi = Wifi {
5151
common: WifiCommon {
5252
protocol_handler: NinaProtocolHandler {
5353
bus: spi,
54-
control_pins: control_pins,
54+
control_pins: esp32_control_pins,
5555
},
5656
},
5757
};

0 commit comments

Comments
 (0)