Skip to content

Commit

Permalink
Merge pull request tock#4101 from tock/clippy-redundant_field_names
Browse files Browse the repository at this point in the history
clippy: deny `redundant_field_names`
  • Loading branch information
alevy authored Jul 13, 2024
2 parents bc7785d + 09a2c62 commit 634b577
Show file tree
Hide file tree
Showing 195 changed files with 553 additions and 591 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ let_and_return = "allow"
missing_safety_doc = "allow"
needless-range-loop = "allow"
option_map_or_none = "allow"
redundant_field_names = "allow"
redundant_pattern_matching = "allow"
unusual-byte-groupings = "allow"
doc_lazy_continuation = "allow"
Expand Down
4 changes: 2 additions & 2 deletions arch/cortex-m/src/mpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ impl CortexMRegion {

CortexMRegion {
location: Some((logical_start, logical_size)),
base_address: base_address,
attributes: attributes,
base_address,
attributes,
}
}

Expand Down
10 changes: 5 additions & 5 deletions boards/arty_e21/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ unsafe fn start() -> (
.finalize(components::priority_component_static!());

let artye21 = ArtyE21 {
console: console,
gpio: gpio,
alarm: alarm,
led: led,
button: button,
console,
gpio,
alarm,
led,
button,
// ipc: kernel::ipc::IPC::new(board_kernel),
scheduler,
};
Expand Down
2 changes: 1 addition & 1 deletion boards/arty_e21/src/timer_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct TimerTest<'a, A: Alarm<'a>> {

impl<'a, A: Alarm<'a>> TimerTest<'a, A> {
pub const fn new(alarm: &'a A) -> TimerTest<'a, A> {
TimerTest { alarm: alarm }
TimerTest { alarm }
}

pub fn start(&self) {
Expand Down
26 changes: 13 additions & 13 deletions boards/clue_nrf52840/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,25 +759,25 @@ unsafe fn start() -> (
.finalize(components::round_robin_component_static!(NUM_PROCS));

let platform = Platform {
ble_radio: ble_radio,
ieee802154_radio: ieee802154_radio,
console: console,
proximity: proximity,
led: led,
gpio: gpio,
ble_radio,
ieee802154_radio,
console,
proximity,
led,
gpio,
adc: adc_syscall,
screen: screen,
button: button,
rng: rng,
buzzer: buzzer,
alarm: alarm,
screen,
button,
rng,
buzzer,
alarm,
ipc: kernel::ipc::IPC::new(
board_kernel,
kernel::ipc::DRIVER_NUM,
&memory_allocation_capability,
),
temperature: temperature,
humidity: humidity,
temperature,
humidity,
scheduler,
systick: cortexm4::systick::SysTick::new_with_calibration(64000000),
};
Expand Down
8 changes: 4 additions & 4 deletions boards/components/src/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct AdcMuxComponent<A: 'static + adc::Adc<'static>> {

impl<A: 'static + adc::Adc<'static>> AdcMuxComponent<A> {
pub fn new(adc: &'static A) -> Self {
AdcMuxComponent { adc: adc }
AdcMuxComponent { adc }
}
}

Expand All @@ -89,7 +89,7 @@ impl<A: 'static + adc::Adc<'static>> AdcComponent<A> {
pub fn new(mux: &'static MuxAdc<'static, A>, channel: A::Channel) -> Self {
AdcComponent {
adc_mux: mux,
channel: channel,
channel,
}
}
}
Expand All @@ -115,8 +115,8 @@ pub struct AdcVirtualComponent {
impl AdcVirtualComponent {
pub fn new(board_kernel: &'static kernel::Kernel, driver_num: usize) -> AdcVirtualComponent {
AdcVirtualComponent {
board_kernel: board_kernel,
driver_num: driver_num,
board_kernel,
driver_num,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions boards/components/src/alarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ impl<A: 'static + time::Alarm<'static>> AlarmDriverComponent<A> {
mux: &'static MuxAlarm<'static, A>,
) -> AlarmDriverComponent<A> {
AlarmDriverComponent {
board_kernel: board_kernel,
driver_num: driver_num,
board_kernel,
driver_num,
alarm_mux: mux,
}
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/bme280.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<I: 'static + i2c::I2CMaster<'static>> Bme280Component<I> {
pub fn new(i2c: &'static MuxI2C<'static, I>, i2c_address: u8) -> Self {
Bme280Component {
i2c_mux: i2c,
i2c_address: i2c_address,
i2c_address,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/bmm150.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<I: 'static + i2c::I2CMaster<'static>> BMM150Component<I> {
pub fn new(i2c: &'static MuxI2C<'static, I>, i2c_address: u8) -> Self {
BMM150Component {
i2c_mux: i2c,
i2c_address: i2c_address,
i2c_address,
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions boards/components/src/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,7 @@ pub struct I2CMasterBusComponent<I: 'static + i2c::I2CMaster<'static>> {

impl<I: 'static + i2c::I2CMaster<'static>> I2CMasterBusComponent<I> {
pub fn new(i2c_mux: &'static MuxI2C<'static, I>, address: u8) -> I2CMasterBusComponent<I> {
I2CMasterBusComponent {
i2c_mux: i2c_mux,
address: address,
}
I2CMasterBusComponent { i2c_mux, address }
}
}

Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<IP: 'static + gpio::InterruptPin<'static>> ButtonComponent<IP> {
)],
) -> Self {
Self {
board_kernel: board_kernel,
board_kernel,
driver_num,
button_pins,
}
Expand Down
20 changes: 10 additions & 10 deletions boards/components/src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ impl<const RX_BUF_LEN: usize, const TX_BUF_LEN: usize> ConsoleComponent<RX_BUF_L
uart_mux: &'static MuxUart,
) -> ConsoleComponent<RX_BUF_LEN, TX_BUF_LEN> {
ConsoleComponent {
board_kernel: board_kernel,
driver_num: driver_num,
uart_mux: uart_mux,
board_kernel,
driver_num,
uart_mux,
}
}
}
Expand Down Expand Up @@ -208,13 +208,13 @@ impl<A: 'static + time::Alarm<'static>> ConsoleOrderedComponent<A> {
write_timer: u32,
) -> ConsoleOrderedComponent<A> {
ConsoleOrderedComponent {
board_kernel: board_kernel,
driver_num: driver_num,
uart_mux: uart_mux,
alarm_mux: alarm_mux,
atomic_size: atomic_size,
retry_timer: retry_timer,
write_timer: write_timer,
board_kernel,
driver_num,
uart_mux,
alarm_mux,
atomic_size,
retry_timer,
write_timer,
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions boards/components/src/crc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ impl<C: 'static + Crc<'static>> CrcComponent<C> {
crc: &'static C,
) -> CrcComponent<C> {
CrcComponent {
board_kernel: board_kernel,
driver_num: driver_num,
crc: crc,
board_kernel,
driver_num,
crc,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/fxos8700.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<I: 'static + i2c::I2CMaster<'static>> Fxos8700Component<I> {
Fxos8700Component {
i2c_mux: i2c,
i2c_address,
gpio: gpio,
gpio,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl<IP: 'static + gpio::InterruptPin<'static>> GpioComponent<IP> {
gpio_pins: &'static [Option<&'static gpio::InterruptValueWrapper<'static, IP>>],
) -> Self {
Self {
board_kernel: board_kernel,
board_kernel,
driver_num,
gpio_pins,
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/hs3003.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl<I: 'static + i2c::I2CMaster<'static>> Hs3003Component<I> {
pub fn new(i2c: &'static MuxI2C<'static, I>, i2c_address: u8) -> Self {
Hs3003Component {
i2c_mux: i2c,
i2c_address: i2c_address,
i2c_address,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/hts221.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl<I: 'static + i2c::I2CMaster<'static>> Hts221Component<I> {
pub fn new(i2c: &'static MuxI2C<'static, I>, i2c_address: u8) -> Self {
Hts221Component {
i2c_mux: i2c,
i2c_address: i2c_address,
i2c_address,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<I: 'static + i2c::I2CMaster<'static>> I2CComponent<I> {
pub fn new(mux: &'static MuxI2C<'static, I>, address: u8) -> Self {
I2CComponent {
i2c_mux: mux,
address: address,
address,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions boards/components/src/isl29035.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ impl<L: 'static + hil::sensors::AmbientLight<'static>> AmbientLightComponent<L>
light_sensor: &'static L,
) -> Self {
AmbientLightComponent {
board_kernel: board_kernel,
driver_num: driver_num,
board_kernel,
driver_num,
light_sensor,
}
}
Expand Down
6 changes: 3 additions & 3 deletions boards/components/src/lldb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ impl LowLevelDebugComponent {
uart_mux: &'static MuxUart,
) -> LowLevelDebugComponent {
LowLevelDebugComponent {
board_kernel: board_kernel,
driver_num: driver_num,
uart_mux: uart_mux,
board_kernel,
driver_num,
uart_mux,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/mlx90614.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<I: 'static + i2c::I2CMaster<'static>, S: 'static + i2c::SMBusMaster<'static
) -> Self {
Mlx90614SMBusComponent {
i2c_mux: i2c,
i2c_address: i2c_address,
i2c_address,
board_kernel,
driver_num,
}
Expand Down
4 changes: 2 additions & 2 deletions boards/components/src/ninedof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub struct NineDofComponent {
impl NineDofComponent {
pub fn new(board_kernel: &'static kernel::Kernel, driver_num: usize) -> NineDofComponent {
NineDofComponent {
board_kernel: board_kernel,
driver_num: driver_num,
board_kernel,
driver_num,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions boards/components/src/nrf51822.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ impl<U: 'static + hil::uart::UartAdvanced<'static>, G: 'static + hil::gpio::Pin>
reset_pin: &'static G,
) -> Nrf51822Component<U, G> {
Nrf51822Component {
board_kernel: board_kernel,
driver_num: driver_num,
uart: uart,
reset_pin: reset_pin,
board_kernel,
driver_num,
uart,
reset_pin,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions boards/components/src/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct PwmMuxComponent<P: 'static + pwm::Pwm> {

impl<P: 'static + pwm::Pwm> PwmMuxComponent<P> {
pub fn new(pwm: &'static P) -> Self {
PwmMuxComponent { pwm: pwm }
PwmMuxComponent { pwm }
}
}

Expand All @@ -74,7 +74,7 @@ impl<P: 'static + pwm::Pwm> PwmPinUserComponent<P> {
pub fn new(mux: &'static MuxPwm<'static, P>, channel: P::Pin) -> Self {
PwmPinUserComponent {
pwm_mux: mux,
channel: channel,
channel,
}
}
}
Expand Down Expand Up @@ -103,8 +103,8 @@ impl<const NUM_PINS: usize> PwmDriverComponent<NUM_PINS> {
driver_num: usize,
) -> PwmDriverComponent<NUM_PINS> {
PwmDriverComponent {
board_kernel: board_kernel,
driver_num: driver_num,
board_kernel,
driver_num,
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions boards/components/src/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ pub struct RngComponent<E: Entropy32<'static> + 'static> {
impl<E: Entropy32<'static>> RngComponent<E> {
pub fn new(board_kernel: &'static kernel::Kernel, driver_num: usize, trng: &'static E) -> Self {
Self {
board_kernel: board_kernel,
driver_num: driver_num,
trng: trng,
board_kernel,
driver_num,
trng,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions boards/components/src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ impl<const SCREEN_BUF_LEN: usize> ScreenComponent<SCREEN_BUF_LEN> {
screen_setup: Option<&'static dyn kernel::hil::screen::ScreenSetup>,
) -> ScreenComponent<SCREEN_BUF_LEN> {
ScreenComponent {
board_kernel: board_kernel,
driver_num: driver_num,
screen: screen,
screen_setup: screen_setup,
board_kernel,
driver_num,
screen,
screen_setup,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion boards/components/src/si7021.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl<A: 'static + time::Alarm<'static>, I: 'static + i2c::I2CMaster<'static>>
SI7021Component {
i2c_mux: i2c,
alarm_mux: alarm,
i2c_address: i2c_address,
i2c_address,
}
}
}
Expand Down
Loading

0 comments on commit 634b577

Please sign in to comment.