From 09a2c6272bde37382598e25872906b609e12c051 Mon Sep 17 00:00:00 2001 From: Brad Campbell Date: Fri, 12 Jul 2024 09:58:52 -0400 Subject: [PATCH] clippy: deny redundant_field_names --- Cargo.toml | 1 - arch/cortex-m/src/mpu.rs | 4 +- boards/arty_e21/src/main.rs | 10 +-- boards/arty_e21/src/timer_test.rs | 2 +- boards/clue_nrf52840/src/main.rs | 26 +++--- boards/components/src/adc.rs | 8 +- boards/components/src/alarm.rs | 4 +- boards/components/src/bme280.rs | 2 +- boards/components/src/bmm150.rs | 2 +- boards/components/src/bus.rs | 5 +- boards/components/src/button.rs | 2 +- boards/components/src/console.rs | 20 ++--- boards/components/src/crc.rs | 6 +- boards/components/src/fxos8700.rs | 2 +- boards/components/src/gpio.rs | 2 +- boards/components/src/hs3003.rs | 2 +- boards/components/src/hts221.rs | 2 +- boards/components/src/i2c.rs | 2 +- boards/components/src/isl29035.rs | 4 +- boards/components/src/lldb.rs | 6 +- boards/components/src/mlx90614.rs | 2 +- boards/components/src/ninedof.rs | 4 +- boards/components/src/nrf51822.rs | 8 +- boards/components/src/pwm.rs | 8 +- boards/components/src/rng.rs | 6 +- boards/components/src/screen.rs | 8 +- boards/components/src/si7021.rs | 2 +- boards/components/src/spi.rs | 6 +- boards/components/src/temperature_stm.rs | 4 +- boards/components/src/text_screen.rs | 6 +- boards/components/src/touch.rs | 20 ++--- boards/hifive1/src/main.rs | 6 +- boards/hifive_inventor/src/main.rs | 8 +- boards/imix/src/test/icmp_lowpan_test.rs | 6 +- boards/imix/src/test/ipv6_lowpan_test.rs | 6 +- boards/imix/src/test/udp_lowpan_test.rs | 8 +- boards/imxrt1050-evkb/src/main.rs | 12 +-- boards/litex/sim/src/main.rs | 12 +-- boards/msp_exp432p401r/src/main.rs | 10 +-- boards/nano_rp2040_connect/src/main.rs | 12 +-- boards/nucleo_f429zi/src/main.rs | 16 ++-- boards/nucleo_f446re/src/main.rs | 10 +-- boards/opentitan/src/main.rs | 6 +- boards/redboard_redv/src/main.rs | 6 +- boards/stm32f3discovery/src/main.rs | 20 ++--- boards/stm32f429idiscovery/src/main.rs | 10 +-- boards/weact_f401ccu6/src/main.rs | 10 +-- boards/wm1110dev/src/main.rs | 4 +- capsules/core/src/adc.rs | 6 +- capsules/core/src/alarm.rs | 2 +- capsules/core/src/button.rs | 5 +- capsules/core/src/console.rs | 2 +- capsules/core/src/console_ordered.rs | 4 +- capsules/core/src/gpio.rs | 5 +- capsules/core/src/led.rs | 2 +- capsules/core/src/process_console.rs | 16 ++-- capsules/core/src/rng.rs | 10 +-- capsules/core/src/spi_controller.rs | 2 +- capsules/core/src/spi_peripheral.rs | 2 +- capsules/core/src/test/alarm.rs | 2 +- capsules/core/src/test/alarm_edge_cases.rs | 2 +- capsules/core/src/test/random_alarm.rs | 2 +- capsules/core/src/test/random_timer.rs | 2 +- capsules/core/src/test/rng.rs | 8 +- capsules/core/src/test/virtual_rng.rs | 4 +- capsules/core/src/test/virtual_uart.rs | 2 +- capsules/core/src/virtualizers/virtual_adc.rs | 6 +- .../core/src/virtualizers/virtual_aes_ccm.rs | 16 ++-- .../core/src/virtualizers/virtual_alarm.rs | 2 +- .../core/src/virtualizers/virtual_flash.rs | 4 +- capsules/core/src/virtualizers/virtual_i2c.rs | 8 +- capsules/core/src/virtualizers/virtual_pwm.rs | 6 +- capsules/core/src/virtualizers/virtual_rng.rs | 4 +- capsules/core/src/virtualizers/virtual_spi.rs | 6 +- .../core/src/virtualizers/virtual_timer.rs | 2 +- .../core/src/virtualizers/virtual_uart.rs | 6 +- capsules/extra/src/air_quality.rs | 2 +- capsules/extra/src/ambient_light.rs | 2 +- capsules/extra/src/analog_sensor.rs | 12 +-- capsules/extra/src/apds9960.rs | 4 +- capsules/extra/src/app_flash_driver.rs | 2 +- capsules/extra/src/ble_advertising_driver.rs | 4 +- capsules/extra/src/bmm150.rs | 2 +- capsules/extra/src/bmp280.rs | 2 +- capsules/extra/src/bus.rs | 2 +- capsules/extra/src/buzzer_driver.rs | 4 +- capsules/extra/src/buzzer_pwm.rs | 6 +- capsules/extra/src/dac.rs | 2 +- capsules/extra/src/debug_process_restart.rs | 2 +- capsules/extra/src/eui64.rs | 2 +- capsules/extra/src/fm25cl.rs | 2 +- capsules/extra/src/ft6x06.rs | 4 +- capsules/extra/src/fxos8700cq.rs | 4 +- capsules/extra/src/hd44780.rs | 14 ++-- capsules/extra/src/hmac.rs | 2 +- capsules/extra/src/humidity.rs | 2 +- capsules/extra/src/ieee802154/driver.rs | 9 +- capsules/extra/src/ieee802154/framer.rs | 26 +++--- capsules/extra/src/ieee802154/mac.rs | 2 +- capsules/extra/src/ieee802154/virtual_mac.rs | 4 +- capsules/extra/src/ieee802154/xmac.rs | 6 +- capsules/extra/src/isl29035.rs | 4 +- capsules/extra/src/l3gd20.rs | 4 +- capsules/extra/src/led_matrix.rs | 4 +- capsules/extra/src/lps22hb.rs | 2 +- capsules/extra/src/lps25hb.rs | 4 +- capsules/extra/src/lsm303agr.rs | 4 +- capsules/extra/src/lsm303dlhc.rs | 4 +- capsules/extra/src/lsm6dsoxtr.rs | 2 +- capsules/extra/src/ltc294x.rs | 6 +- capsules/extra/src/max17205.rs | 4 +- capsules/extra/src/mcp230xx.rs | 10 +-- capsules/extra/src/mx25r6435f.rs | 8 +- capsules/extra/src/net/icmpv6/icmpv6.rs | 2 +- capsules/extra/src/net/icmpv6/icmpv6_send.rs | 2 +- capsules/extra/src/net/ieee802154.rs | 45 +++++----- capsules/extra/src/net/ipv6/ipv6.rs | 9 +- capsules/extra/src/net/ipv6/ipv6_send.rs | 12 +-- .../extra/src/net/network_capabilities.rs | 6 +- .../src/net/sixlowpan/sixlowpan_state.rs | 6 +- capsules/extra/src/net/thread/driver.rs | 16 ++-- capsules/extra/src/net/thread/tlv.rs | 84 +++++++++---------- capsules/extra/src/net/udp/driver.rs | 14 ++-- capsules/extra/src/net/udp/udp_port_table.rs | 14 +--- capsules/extra/src/net/udp/udp_send.rs | 4 +- capsules/extra/src/ninedof.rs | 2 +- .../extra/src/nonvolatile_storage_driver.rs | 18 ++-- capsules/extra/src/nonvolatile_to_pages.rs | 2 +- capsules/extra/src/nrf51822_serialization.rs | 4 +- capsules/extra/src/pressure.rs | 4 +- capsules/extra/src/proximity.rs | 2 +- capsules/extra/src/pwm.rs | 2 +- capsules/extra/src/rf233.rs | 2 +- capsules/extra/src/screen.rs | 4 +- capsules/extra/src/screen_shared.rs | 2 +- capsules/extra/src/sdcard.rs | 16 ++-- capsules/extra/src/segger_rtt.rs | 2 +- capsules/extra/src/seven_segment.rs | 4 +- capsules/extra/src/sha.rs | 2 +- capsules/extra/src/sht3x.rs | 4 +- capsules/extra/src/sht4x.rs | 4 +- capsules/extra/src/si7021.rs | 4 +- capsules/extra/src/sound_pressure.rs | 2 +- capsules/extra/src/st77xx.rs | 10 +-- capsules/extra/src/temperature.rs | 2 +- capsules/extra/src/temperature_rp2040.rs | 6 +- capsules/extra/src/temperature_stm.rs | 6 +- capsules/extra/src/test/aes.rs | 6 +- capsules/extra/src/test/aes_ccm.rs | 2 +- capsules/extra/src/test/aes_gcm.rs | 2 +- capsules/extra/src/test/crc.rs | 2 +- capsules/extra/src/test/kv_system.rs | 2 +- capsules/extra/src/test/sha256.rs | 2 +- capsules/extra/src/test/udp.rs | 10 +-- capsules/extra/src/text_screen.rs | 2 +- capsules/extra/src/touch.rs | 6 +- capsules/extra/src/tsl2561.rs | 4 +- .../src/tutorials/encryption_oracle_chkpt1.rs | 4 +- .../src/tutorials/encryption_oracle_chkpt2.rs | 4 +- .../src/tutorials/encryption_oracle_chkpt3.rs | 4 +- .../src/tutorials/encryption_oracle_chkpt4.rs | 4 +- .../src/tutorials/encryption_oracle_chkpt5.rs | 4 +- capsules/extra/src/usb/cdc.rs | 8 +- capsules/extra/src/usb/ctap.rs | 4 +- capsules/extra/src/usb/keyboard_hid.rs | 4 +- capsules/extra/src/usb/usb_user.rs | 4 +- capsules/extra/src/usb/usbc_client_ctrl.rs | 2 +- capsules/extra/src/usb_hid_driver.rs | 2 +- chips/imxrt10xx/src/lpuart.rs | 2 +- chips/lowrisc/src/aon_timer.rs | 2 +- chips/lowrisc/src/gpio.rs | 4 +- chips/lowrisc/src/spi_host.rs | 2 +- chips/lowrisc/src/uart.rs | 2 +- chips/lowrisc/src/usbdev.rs | 2 +- chips/lowrisc/src/virtual_otbn.rs | 2 +- chips/msp432/src/dma.rs | 2 +- chips/msp432/src/i2c.rs | 2 +- chips/msp432/src/uart.rs | 8 +- chips/rp2040/src/chip.rs | 2 +- chips/sam4l/src/adc.rs | 2 +- chips/sam4l/src/flashcalw.rs | 3 +- chips/sam4l/src/usart.rs | 4 +- chips/sam4l/src/usbc/mod.rs | 2 +- chips/sifive/src/gpio.rs | 6 +- chips/sifive/src/uart.rs | 2 +- chips/stm32f303xc/src/usart.rs | 2 +- chips/stm32f4xx/src/can.rs | 2 +- chips/stm32f4xx/src/dma.rs | 2 +- chips/stm32f4xx/src/spi.rs | 4 +- chips/stm32f4xx/src/trng.rs | 2 +- chips/stm32f4xx/src/usart.rs | 6 +- .../tock-register-interface/src/fields.rs | 4 +- .../src/local_register.rs | 2 +- libraries/tock-tbf/src/parse.rs | 4 +- libraries/tock-tbf/src/types.rs | 2 +- 195 files changed, 553 insertions(+), 591 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 33e909405b..e83a1a320c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -199,7 +199,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" wrong-self-convention = "allow" diff --git a/arch/cortex-m/src/mpu.rs b/arch/cortex-m/src/mpu.rs index 17ca986ebc..e1cfaede1a 100644 --- a/arch/cortex-m/src/mpu.rs +++ b/arch/cortex-m/src/mpu.rs @@ -327,8 +327,8 @@ impl CortexMRegion { CortexMRegion { location: Some((logical_start, logical_size)), - base_address: base_address, - attributes: attributes, + base_address, + attributes, } } diff --git a/boards/arty_e21/src/main.rs b/boards/arty_e21/src/main.rs index 961c3493b6..23ad988784 100644 --- a/boards/arty_e21/src/main.rs +++ b/boards/arty_e21/src/main.rs @@ -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, }; diff --git a/boards/arty_e21/src/timer_test.rs b/boards/arty_e21/src/timer_test.rs index 06e9dd9679..bc68b8e5a2 100644 --- a/boards/arty_e21/src/timer_test.rs +++ b/boards/arty_e21/src/timer_test.rs @@ -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) { diff --git a/boards/clue_nrf52840/src/main.rs b/boards/clue_nrf52840/src/main.rs index 73fbf8815a..10283610a9 100644 --- a/boards/clue_nrf52840/src/main.rs +++ b/boards/clue_nrf52840/src/main.rs @@ -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), }; diff --git a/boards/components/src/adc.rs b/boards/components/src/adc.rs index 81c83495f0..6f31caa59d 100644 --- a/boards/components/src/adc.rs +++ b/boards/components/src/adc.rs @@ -63,7 +63,7 @@ pub struct AdcMuxComponent> { impl> AdcMuxComponent { pub fn new(adc: &'static A) -> Self { - AdcMuxComponent { adc: adc } + AdcMuxComponent { adc } } } @@ -89,7 +89,7 @@ impl> AdcComponent { pub fn new(mux: &'static MuxAdc<'static, A>, channel: A::Channel) -> Self { AdcComponent { adc_mux: mux, - channel: channel, + channel, } } } @@ -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, } } } diff --git a/boards/components/src/alarm.rs b/boards/components/src/alarm.rs index 11b05574b8..e224cd82f5 100644 --- a/boards/components/src/alarm.rs +++ b/boards/components/src/alarm.rs @@ -97,8 +97,8 @@ impl> AlarmDriverComponent { mux: &'static MuxAlarm<'static, A>, ) -> AlarmDriverComponent { AlarmDriverComponent { - board_kernel: board_kernel, - driver_num: driver_num, + board_kernel, + driver_num, alarm_mux: mux, } } diff --git a/boards/components/src/bme280.rs b/boards/components/src/bme280.rs index b7ec25f39e..1c527409dd 100644 --- a/boards/components/src/bme280.rs +++ b/boards/components/src/bme280.rs @@ -58,7 +58,7 @@ impl> Bme280Component { pub fn new(i2c: &'static MuxI2C<'static, I>, i2c_address: u8) -> Self { Bme280Component { i2c_mux: i2c, - i2c_address: i2c_address, + i2c_address, } } } diff --git a/boards/components/src/bmm150.rs b/boards/components/src/bmm150.rs index 6343a0aba6..39b2beee4f 100644 --- a/boards/components/src/bmm150.rs +++ b/boards/components/src/bmm150.rs @@ -47,7 +47,7 @@ impl> BMM150Component { pub fn new(i2c: &'static MuxI2C<'static, I>, i2c_address: u8) -> Self { BMM150Component { i2c_mux: i2c, - i2c_address: i2c_address, + i2c_address, } } } diff --git a/boards/components/src/bus.rs b/boards/components/src/bus.rs index 6ddf9dd1cd..6be6b7dd7f 100644 --- a/boards/components/src/bus.rs +++ b/boards/components/src/bus.rs @@ -160,10 +160,7 @@ pub struct I2CMasterBusComponent> { impl> I2CMasterBusComponent { pub fn new(i2c_mux: &'static MuxI2C<'static, I>, address: u8) -> I2CMasterBusComponent { - I2CMasterBusComponent { - i2c_mux: i2c_mux, - address: address, - } + I2CMasterBusComponent { i2c_mux, address } } } diff --git a/boards/components/src/button.rs b/boards/components/src/button.rs index 942596a986..2d1dfb9887 100644 --- a/boards/components/src/button.rs +++ b/boards/components/src/button.rs @@ -107,7 +107,7 @@ impl> ButtonComponent { )], ) -> Self { Self { - board_kernel: board_kernel, + board_kernel, driver_num, button_pins, } diff --git a/boards/components/src/console.rs b/boards/components/src/console.rs index 9db208e5cc..97d20fa376 100644 --- a/boards/components/src/console.rs +++ b/boards/components/src/console.rs @@ -135,9 +135,9 @@ impl ConsoleComponent ConsoleComponent { ConsoleComponent { - board_kernel: board_kernel, - driver_num: driver_num, - uart_mux: uart_mux, + board_kernel, + driver_num, + uart_mux, } } } @@ -208,13 +208,13 @@ impl> ConsoleOrderedComponent { write_timer: u32, ) -> ConsoleOrderedComponent { 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, } } } diff --git a/boards/components/src/crc.rs b/boards/components/src/crc.rs index 60daad3389..e1b382aa9f 100644 --- a/boards/components/src/crc.rs +++ b/boards/components/src/crc.rs @@ -49,9 +49,9 @@ impl> CrcComponent { crc: &'static C, ) -> CrcComponent { CrcComponent { - board_kernel: board_kernel, - driver_num: driver_num, - crc: crc, + board_kernel, + driver_num, + crc, } } } diff --git a/boards/components/src/fxos8700.rs b/boards/components/src/fxos8700.rs index ed8c6c5a3c..e2d2a620b7 100644 --- a/boards/components/src/fxos8700.rs +++ b/boards/components/src/fxos8700.rs @@ -57,7 +57,7 @@ impl> Fxos8700Component { Fxos8700Component { i2c_mux: i2c, i2c_address, - gpio: gpio, + gpio, } } } diff --git a/boards/components/src/gpio.rs b/boards/components/src/gpio.rs index 89ab07b306..af726a9f5a 100644 --- a/boards/components/src/gpio.rs +++ b/boards/components/src/gpio.rs @@ -134,7 +134,7 @@ impl> GpioComponent { gpio_pins: &'static [Option<&'static gpio::InterruptValueWrapper<'static, IP>>], ) -> Self { Self { - board_kernel: board_kernel, + board_kernel, driver_num, gpio_pins, } diff --git a/boards/components/src/hs3003.rs b/boards/components/src/hs3003.rs index d1e2ccebba..19a16689d0 100644 --- a/boards/components/src/hs3003.rs +++ b/boards/components/src/hs3003.rs @@ -48,7 +48,7 @@ impl> Hs3003Component { pub fn new(i2c: &'static MuxI2C<'static, I>, i2c_address: u8) -> Self { Hs3003Component { i2c_mux: i2c, - i2c_address: i2c_address, + i2c_address, } } } diff --git a/boards/components/src/hts221.rs b/boards/components/src/hts221.rs index 4308aa5c9e..c97248fb35 100644 --- a/boards/components/src/hts221.rs +++ b/boards/components/src/hts221.rs @@ -48,7 +48,7 @@ impl> Hts221Component { pub fn new(i2c: &'static MuxI2C<'static, I>, i2c_address: u8) -> Self { Hts221Component { i2c_mux: i2c, - i2c_address: i2c_address, + i2c_address, } } } diff --git a/boards/components/src/i2c.rs b/boards/components/src/i2c.rs index c546eee7a5..0d3c82c96b 100644 --- a/boards/components/src/i2c.rs +++ b/boards/components/src/i2c.rs @@ -107,7 +107,7 @@ impl> I2CComponent { pub fn new(mux: &'static MuxI2C<'static, I>, address: u8) -> Self { I2CComponent { i2c_mux: mux, - address: address, + address, } } } diff --git a/boards/components/src/isl29035.rs b/boards/components/src/isl29035.rs index 40261de70b..437ee8562c 100644 --- a/boards/components/src/isl29035.rs +++ b/boards/components/src/isl29035.rs @@ -128,8 +128,8 @@ impl> AmbientLightComponent light_sensor: &'static L, ) -> Self { AmbientLightComponent { - board_kernel: board_kernel, - driver_num: driver_num, + board_kernel, + driver_num, light_sensor, } } diff --git a/boards/components/src/lldb.rs b/boards/components/src/lldb.rs index ccb8646030..382296037f 100644 --- a/boards/components/src/lldb.rs +++ b/boards/components/src/lldb.rs @@ -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, } } } diff --git a/boards/components/src/mlx90614.rs b/boards/components/src/mlx90614.rs index db255eaac5..b883819715 100644 --- a/boards/components/src/mlx90614.rs +++ b/boards/components/src/mlx90614.rs @@ -59,7 +59,7 @@ impl, S: 'static + i2c::SMBusMaster<'static ) -> Self { Mlx90614SMBusComponent { i2c_mux: i2c, - i2c_address: i2c_address, + i2c_address, board_kernel, driver_num, } diff --git a/boards/components/src/ninedof.rs b/boards/components/src/ninedof.rs index 68532db4a4..3d2f5dee05 100644 --- a/boards/components/src/ninedof.rs +++ b/boards/components/src/ninedof.rs @@ -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, } } } diff --git a/boards/components/src/nrf51822.rs b/boards/components/src/nrf51822.rs index 434b33d44a..ff77a0000c 100644 --- a/boards/components/src/nrf51822.rs +++ b/boards/components/src/nrf51822.rs @@ -60,10 +60,10 @@ impl, G: 'static + hil::gpio::Pin> reset_pin: &'static G, ) -> Nrf51822Component { Nrf51822Component { - board_kernel: board_kernel, - driver_num: driver_num, - uart: uart, - reset_pin: reset_pin, + board_kernel, + driver_num, + uart, + reset_pin, } } } diff --git a/boards/components/src/pwm.rs b/boards/components/src/pwm.rs index 27a5c71fc4..b055d65b3b 100644 --- a/boards/components/src/pwm.rs +++ b/boards/components/src/pwm.rs @@ -50,7 +50,7 @@ pub struct PwmMuxComponent { impl PwmMuxComponent

{ pub fn new(pwm: &'static P) -> Self { - PwmMuxComponent { pwm: pwm } + PwmMuxComponent { pwm } } } @@ -74,7 +74,7 @@ impl PwmPinUserComponent

{ pub fn new(mux: &'static MuxPwm<'static, P>, channel: P::Pin) -> Self { PwmPinUserComponent { pwm_mux: mux, - channel: channel, + channel, } } } @@ -103,8 +103,8 @@ impl PwmDriverComponent { driver_num: usize, ) -> PwmDriverComponent { PwmDriverComponent { - board_kernel: board_kernel, - driver_num: driver_num, + board_kernel, + driver_num, } } } diff --git a/boards/components/src/rng.rs b/boards/components/src/rng.rs index 58c7def58c..a828ffa5e5 100644 --- a/boards/components/src/rng.rs +++ b/boards/components/src/rng.rs @@ -52,9 +52,9 @@ pub struct RngComponent + 'static> { impl> RngComponent { 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, } } } diff --git a/boards/components/src/screen.rs b/boards/components/src/screen.rs index 4b9e8ac580..00e90d76bd 100644 --- a/boards/components/src/screen.rs +++ b/boards/components/src/screen.rs @@ -65,10 +65,10 @@ impl ScreenComponent { screen_setup: Option<&'static dyn kernel::hil::screen::ScreenSetup>, ) -> ScreenComponent { ScreenComponent { - board_kernel: board_kernel, - driver_num: driver_num, - screen: screen, - screen_setup: screen_setup, + board_kernel, + driver_num, + screen, + screen_setup, } } } diff --git a/boards/components/src/si7021.rs b/boards/components/src/si7021.rs index 6d2d488383..0703114f8c 100644 --- a/boards/components/src/si7021.rs +++ b/boards/components/src/si7021.rs @@ -68,7 +68,7 @@ impl, I: 'static + i2c::I2CMaster<'static>> SI7021Component { i2c_mux: i2c, alarm_mux: alarm, - i2c_address: i2c_address, + i2c_address, } } } diff --git a/boards/components/src/spi.rs b/boards/components/src/spi.rs index 6d2ae5dc94..b824c05454 100644 --- a/boards/components/src/spi.rs +++ b/boards/components/src/spi.rs @@ -162,9 +162,9 @@ impl> SpiSyscallComponent { driver_num: usize, ) -> Self { SpiSyscallComponent { - board_kernel: board_kernel, + board_kernel, spi_mux: mux, - chip_select: chip_select, + chip_select, driver_num, } } @@ -250,7 +250,7 @@ impl> SpiComponent { pub fn new(mux: &'static MuxSpiMaster<'static, S>, chip_select: S::ChipSelect) -> Self { SpiComponent { spi_mux: mux, - chip_select: chip_select, + chip_select, } } } diff --git a/boards/components/src/temperature_stm.rs b/boards/components/src/temperature_stm.rs index 42257b54b4..14bbe50ece 100644 --- a/boards/components/src/temperature_stm.rs +++ b/boards/components/src/temperature_stm.rs @@ -46,8 +46,8 @@ impl> TemperatureSTMComponent { TemperatureSTMComponent { adc_mux, adc_channel, - slope: slope, - v_25: v_25, + slope, + v_25, } } } diff --git a/boards/components/src/text_screen.rs b/boards/components/src/text_screen.rs index 996466c753..616d70ba87 100644 --- a/boards/components/src/text_screen.rs +++ b/boards/components/src/text_screen.rs @@ -52,9 +52,9 @@ impl TextScreenComponent { text_screen: &'static dyn kernel::hil::text_screen::TextScreen<'static>, ) -> TextScreenComponent { TextScreenComponent { - board_kernel: board_kernel, - driver_num: driver_num, - text_screen: text_screen, + board_kernel, + driver_num, + text_screen, } } } diff --git a/boards/components/src/touch.rs b/boards/components/src/touch.rs index 072e4edb24..48955b9386 100644 --- a/boards/components/src/touch.rs +++ b/boards/components/src/touch.rs @@ -64,11 +64,11 @@ impl TouchComponent { screen: Option<&'static dyn kernel::hil::screen::Screen<'static>>, ) -> TouchComponent { TouchComponent { - board_kernel: board_kernel, - driver_num: driver_num, - touch: touch, - gesture: gesture, - screen: screen, + board_kernel, + driver_num, + touch, + gesture, + screen, } } } @@ -114,11 +114,11 @@ impl MultiTouchComponent { screen: Option<&'static dyn kernel::hil::screen::Screen>, ) -> MultiTouchComponent { MultiTouchComponent { - board_kernel: board_kernel, - driver_num: driver_num, - multi_touch: multi_touch, - gesture: gesture, - screen: screen, + board_kernel, + driver_num, + multi_touch, + gesture, + screen, } } } diff --git a/boards/hifive1/src/main.rs b/boards/hifive1/src/main.rs index c7640b5486..ede5f5481c 100644 --- a/boards/hifive1/src/main.rs +++ b/boards/hifive1/src/main.rs @@ -337,10 +337,10 @@ unsafe fn start() -> ( ); let hifive1 = HiFive1 { - console: console, - alarm: alarm, - lldb: lldb, led, + console, + lldb, + alarm, scheduler, scheduler_timer, }; diff --git a/boards/hifive_inventor/src/main.rs b/boards/hifive_inventor/src/main.rs index 7573152b2f..5c94f783f7 100644 --- a/boards/hifive_inventor/src/main.rs +++ b/boards/hifive_inventor/src/main.rs @@ -280,15 +280,13 @@ unsafe fn start() -> ( VirtualSchedulerTimer>>, VirtualSchedulerTimer::new(systick_virtual_alarm) ); - let hifive1 = HiFiveInventor { - console: console, - alarm: alarm, - lldb: lldb, + console, + lldb, + alarm, scheduler, scheduler_timer, }; - kernel::process::load_processes( board_kernel, chip, diff --git a/boards/imix/src/test/icmp_lowpan_test.rs b/boards/imix/src/test/icmp_lowpan_test.rs index 02a7b563f6..a0b1299cb1 100644 --- a/boards/imix/src/test/icmp_lowpan_test.rs +++ b/boards/imix/src/test/icmp_lowpan_test.rs @@ -202,10 +202,10 @@ impl<'a, A: time::Alarm<'a>> LowpanICMPTest<'a, A> { net_cap: &'static NetworkCapability, ) -> LowpanICMPTest<'a, A> { LowpanICMPTest { - alarm: alarm, + alarm, test_counter: Cell::new(0), - icmp_sender: icmp_sender, - net_cap: net_cap, + icmp_sender, + net_cap, } } diff --git a/boards/imix/src/test/ipv6_lowpan_test.rs b/boards/imix/src/test/ipv6_lowpan_test.rs index 486a80d4ba..3d25082326 100644 --- a/boards/imix/src/test/ipv6_lowpan_test.rs +++ b/boards/imix/src/test/ipv6_lowpan_test.rs @@ -241,9 +241,9 @@ impl<'a, A: time::Alarm<'a>> LowpanTest<'a, A> { alarm: &'a A, ) -> LowpanTest<'a, A> { LowpanTest { - alarm: alarm, - sixlowpan_tx: sixlowpan_tx, - radio: radio, + alarm, + sixlowpan_tx, + radio, test_counter: Cell::new(0), } } diff --git a/boards/imix/src/test/udp_lowpan_test.rs b/boards/imix/src/test/udp_lowpan_test.rs index d60a97ea41..686c2d1845 100644 --- a/boards/imix/src/test/udp_lowpan_test.rs +++ b/boards/imix/src/test/udp_lowpan_test.rs @@ -238,11 +238,11 @@ impl<'a, A: time::Alarm<'a>> LowpanTest<'a, A> { mock_udp2: &'static MockUdp<'a, A>, ) -> LowpanTest<'a, A> { LowpanTest { - alarm: alarm, + alarm, test_counter: Cell::new(0), - port_table: port_table, - mock_udp1: mock_udp1, - mock_udp2: mock_udp2, + port_table, + mock_udp1, + mock_udp2, test_mode: Cell::new(TestMode::DefaultMode), } } diff --git a/boards/imxrt1050-evkb/src/main.rs b/boards/imxrt1050-evkb/src/main.rs index ebd73adffa..660eff4d35 100644 --- a/boards/imxrt1050-evkb/src/main.rs +++ b/boards/imxrt1050-evkb/src/main.rs @@ -453,17 +453,17 @@ unsafe fn start() -> ( .finalize(components::round_robin_component_static!(NUM_PROCS)); let imxrt1050 = Imxrt1050EVKB { - console: console, + console, ipc: kernel::ipc::IPC::new( board_kernel, kernel::ipc::DRIVER_NUM, &memory_allocation_capability, ), - led: led, - button: button, - ninedof: ninedof, - alarm: alarm, - gpio: gpio, + led, + button, + ninedof, + alarm, + gpio, scheduler, systick: cortexm7::systick::SysTick::new_with_calibration(792_000_000), diff --git a/boards/litex/sim/src/main.rs b/boards/litex/sim/src/main.rs index dd7a8d5fc6..80bc40ae44 100644 --- a/boards/litex/sim/src/main.rs +++ b/boards/litex/sim/src/main.rs @@ -659,12 +659,12 @@ unsafe fn start() -> ( .finalize(components::cooperative_component_static!(NUM_PROCS)); let litex_sim = LiteXSim { - gpio_driver: gpio_driver, - button_driver: button_driver, - led_driver: led_driver, - console: console, - alarm: alarm, - lldb: lldb, + gpio_driver, + button_driver, + led_driver, + console, + alarm, + lldb, ipc: kernel::ipc::IPC::new( board_kernel, kernel::ipc::DRIVER_NUM, diff --git a/boards/msp_exp432p401r/src/main.rs b/boards/msp_exp432p401r/src/main.rs index 150fb89ec9..46c63c8b81 100644 --- a/boards/msp_exp432p401r/src/main.rs +++ b/boards/msp_exp432p401r/src/main.rs @@ -414,16 +414,16 @@ unsafe fn start() -> ( let msp_exp432p4014 = MspExp432P401R { led: leds, - console: console, - button: button, - gpio: gpio, - alarm: alarm, + console, + button, + gpio, + alarm, ipc: kernel::ipc::IPC::new( board_kernel, kernel::ipc::DRIVER_NUM, &memory_allocation_capability, ), - adc: adc, + adc, scheduler, systick: cortexm4::systick::SysTick::new_with_calibration(48_000_000), wdt: &peripherals.wdt, diff --git a/boards/nano_rp2040_connect/src/main.rs b/boards/nano_rp2040_connect/src/main.rs index dd90630643..5bc8e38507 100644 --- a/boards/nano_rp2040_connect/src/main.rs +++ b/boards/nano_rp2040_connect/src/main.rs @@ -552,15 +552,15 @@ pub unsafe fn start() -> ( kernel::ipc::DRIVER_NUM, &memory_allocation_capability, ), - alarm: alarm, - gpio: gpio, - led: led, - console: console, + alarm, + gpio, + led, + console, adc: adc_syscall, temperature: temp, - lsm6dsoxtr: lsm6dsoxtr, - ninedof: ninedof, + lsm6dsoxtr, + ninedof, scheduler, systick: cortexm0p::systick::SysTick::new_with_calibration(125_000_000), diff --git a/boards/nucleo_f429zi/src/main.rs b/boards/nucleo_f429zi/src/main.rs index 4939107da2..a97147e350 100644 --- a/boards/nucleo_f429zi/src/main.rs +++ b/boards/nucleo_f429zi/src/main.rs @@ -647,24 +647,24 @@ unsafe fn start() -> ( .finalize(components::round_robin_component_static!(NUM_PROCS)); let nucleo_f429zi = NucleoF429ZI { - console: console, + console, ipc: kernel::ipc::IPC::new( board_kernel, kernel::ipc::DRIVER_NUM, &memory_allocation_capability, ), adc: adc_syscall, - dac: dac, - led: led, + dac, + led, temperature: temp, - button: button, - alarm: alarm, - gpio: gpio, - rng: rng, + button, + alarm, + gpio, + rng, scheduler, systick: cortexm4::systick::SysTick::new(), - can: can, + can, date_time, }; diff --git a/boards/nucleo_f446re/src/main.rs b/boards/nucleo_f446re/src/main.rs index 22958b19e9..ee24c206b6 100644 --- a/boards/nucleo_f446re/src/main.rs +++ b/boards/nucleo_f446re/src/main.rs @@ -492,19 +492,19 @@ unsafe fn start() -> ( .finalize(components::round_robin_component_static!(NUM_PROCS)); let nucleo_f446re = NucleoF446RE { - console: console, + console, ipc: kernel::ipc::IPC::new( board_kernel, kernel::ipc::DRIVER_NUM, &memory_allocation_capability, ), - led: led, - button: button, + led, + button, adc: adc_syscall, - alarm: alarm, + alarm, temperature: temp, - gpio: gpio, + gpio, scheduler, systick: cortexm4::systick::SysTick::new(), diff --git a/boards/opentitan/src/main.rs b/boards/opentitan/src/main.rs index 849b8410be..505d396323 100644 --- a/boards/opentitan/src/main.rs +++ b/boards/opentitan/src/main.rs @@ -842,15 +842,15 @@ unsafe fn setup() -> ( let earlgrey = static_init!( EarlGrey, EarlGrey { - gpio, led, + gpio, console, alarm, hmac, - rng, - lldb: lldb, + lldb, i2c_master, spi_controller, + rng, aes, kv_driver, syscall_filter, diff --git a/boards/redboard_redv/src/main.rs b/boards/redboard_redv/src/main.rs index 6289738167..1e4f54380a 100644 --- a/boards/redboard_redv/src/main.rs +++ b/boards/redboard_redv/src/main.rs @@ -301,10 +301,10 @@ unsafe fn start() -> ( ); let redv = RedV { - console: console, - alarm: alarm, - lldb: lldb, led, + console, + lldb, + alarm, scheduler, scheduler_timer, }; diff --git a/boards/stm32f3discovery/src/main.rs b/boards/stm32f3discovery/src/main.rs index 5dd1008775..b8eab2950b 100644 --- a/boards/stm32f3discovery/src/main.rs +++ b/boards/stm32f3discovery/src/main.rs @@ -788,22 +788,22 @@ unsafe fn start() -> ( .finalize(components::round_robin_component_static!(NUM_PROCS)); let stm32f3discovery = STM32F3Discovery { - console: console, + console, ipc: kernel::ipc::IPC::new( board_kernel, kernel::ipc::DRIVER_NUM, &memory_allocation_capability, ), - gpio: gpio, - led: led, - button: button, - alarm: alarm, - l3gd20: l3gd20, - lsm303dlhc: lsm303dlhc, - ninedof: ninedof, - temp: temp, + gpio, + led, + button, + alarm, + l3gd20, + lsm303dlhc, + ninedof, + temp, adc: adc_syscall, - nonvolatile_storage: nonvolatile_storage, + nonvolatile_storage, scheduler, systick: cortexm4::systick::SysTick::new(), diff --git a/boards/stm32f429idiscovery/src/main.rs b/boards/stm32f429idiscovery/src/main.rs index e7a100888c..44e1b90dd5 100644 --- a/boards/stm32f429idiscovery/src/main.rs +++ b/boards/stm32f429idiscovery/src/main.rs @@ -577,18 +577,18 @@ unsafe fn start() -> ( .finalize(components::round_robin_component_static!(NUM_PROCS)); let stm32f429i_discovery = STM32F429IDiscovery { - console: console, + console, ipc: kernel::ipc::IPC::new( board_kernel, kernel::ipc::DRIVER_NUM, &memory_allocation_capability, ), adc: adc_syscall, - led: led, + led, temperature: temp, - button: button, - alarm: alarm, - gpio: gpio, + button, + alarm, + gpio, scheduler, systick: cortexm4::systick::SysTick::new(), diff --git a/boards/weact_f401ccu6/src/main.rs b/boards/weact_f401ccu6/src/main.rs index 19876ec000..a0ce19683c 100644 --- a/boards/weact_f401ccu6/src/main.rs +++ b/boards/weact_f401ccu6/src/main.rs @@ -436,17 +436,17 @@ unsafe fn start() -> ( .finalize(components::round_robin_component_static!(NUM_PROCS)); let weact_f401cc = WeactF401CC { - console: console, + console, ipc: kernel::ipc::IPC::new( board_kernel, kernel::ipc::DRIVER_NUM, &memory_allocation_capability, ), adc: adc_syscall, - led: led, - button: button, - alarm: alarm, - gpio: gpio, + led, + button, + alarm, + gpio, scheduler, systick: cortexm4::systick::SysTick::new(), }; diff --git a/boards/wm1110dev/src/main.rs b/boards/wm1110dev/src/main.rs index a26759e4d7..f0a22861d6 100644 --- a/boards/wm1110dev/src/main.rs +++ b/boards/wm1110dev/src/main.rs @@ -475,8 +475,8 @@ pub unsafe fn start() -> ( ), scheduler, systick: cortexm4::systick::SysTick::new_with_calibration(64000000), - temperature: temperature, - humidity: humidity, + temperature, + humidity, lr1110_spi, lr1110_gpio, }; diff --git a/capsules/core/src/adc.rs b/capsules/core/src/adc.rs index d4b8833600..446f3d3cf8 100644 --- a/capsules/core/src/adc.rs +++ b/capsules/core/src/adc.rs @@ -171,8 +171,8 @@ impl<'a, A: hil::adc::Adc<'a> + hil::adc::AdcHighSpeed<'a>> AdcDedicated<'a, A> ) -> AdcDedicated<'a, A> { AdcDedicated { // ADC driver - adc: adc, - channels: channels, + adc, + channels, // ADC state active: Cell::new(false), @@ -642,7 +642,7 @@ impl<'a> AdcVirtualized<'a> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> AdcVirtualized<'a> { AdcVirtualized { - drivers: drivers, + drivers, apps: grant, current_process: OptionalCell::empty(), } diff --git a/capsules/core/src/alarm.rs b/capsules/core/src/alarm.rs index 070555f4d0..cbab6e5234 100644 --- a/capsules/core/src/alarm.rs +++ b/capsules/core/src/alarm.rs @@ -51,7 +51,7 @@ impl<'a, A: Alarm<'a>> AlarmDriver<'a, A> { >, ) -> AlarmDriver<'a, A> { AlarmDriver { - alarm: alarm, + alarm, app_alarms: grant, } } diff --git a/capsules/core/src/button.rs b/capsules/core/src/button.rs index 31f4a38983..742e768b42 100644 --- a/capsules/core/src/button.rs +++ b/capsules/core/src/button.rs @@ -106,10 +106,7 @@ impl<'a, P: gpio::InterruptPin<'a>> Button<'a, P> { pin.set_floating_state(floating_state); } - Self { - pins: pins, - apps: grant, - } + Self { pins, apps: grant } } fn get_button_state(&self, pin_num: u32) -> gpio::ActivationState { diff --git a/capsules/core/src/console.rs b/capsules/core/src/console.rs index 7b3f30b772..0077d8796b 100644 --- a/capsules/core/src/console.rs +++ b/capsules/core/src/console.rs @@ -126,7 +126,7 @@ impl<'a> Console<'a> { >, ) -> Console<'a> { Console { - uart: uart, + uart, apps: grant, tx_in_progress: OptionalCell::empty(), tx_buffer: TakeCell::new(tx_buffer), diff --git a/capsules/core/src/console_ordered.rs b/capsules/core/src/console_ordered.rs index 6161493f7b..5d133ab754 100644 --- a/capsules/core/src/console_ordered.rs +++ b/capsules/core/src/console_ordered.rs @@ -162,11 +162,11 @@ impl<'a, A: Alarm<'a>> ConsoleOrdered<'a, A> { write_timer: u32, ) -> ConsoleOrdered<'a, A> { ConsoleOrdered { - uart: uart, + uart, apps: grant, tx_in_progress: Cell::new(false), tx_counter: Cell::new(0), - alarm: alarm, + alarm, rx_counter: Cell::new(0), rx_in_progress: OptionalCell::empty(), diff --git a/capsules/core/src/gpio.rs b/capsules/core/src/gpio.rs index 8c40a8bc39..c8c556b0df 100644 --- a/capsules/core/src/gpio.rs +++ b/capsules/core/src/gpio.rs @@ -82,10 +82,7 @@ impl<'a, IP: gpio::InterruptPin<'a>> GPIO<'a, IP> { pin.set_value(i as u32); } } - Self { - pins: pins, - apps: grant, - } + Self { pins, apps: grant } } fn configure_input_pin(&self, pin_num: u32, config: usize) -> CommandReturn { diff --git a/capsules/core/src/led.rs b/capsules/core/src/led.rs index 9f0d0edc44..0e067175f6 100644 --- a/capsules/core/src/led.rs +++ b/capsules/core/src/led.rs @@ -76,7 +76,7 @@ impl<'a, L: led::Led, const NUM_LEDS: usize> LedDriver<'a, L, NUM_LEDS> { led.off(); } - Self { leds: leds } + Self { leds } } } diff --git a/capsules/core/src/process_console.rs b/capsules/core/src/process_console.rs index 8eca0d8180..d35f22b666 100644 --- a/capsules/core/src/process_console.rs +++ b/capsules/core/src/process_console.rs @@ -451,8 +451,8 @@ impl<'a, const COMMAND_HISTORY_LEN: usize, A: Alarm<'a>, C: ProcessManagementCap capability: C, ) -> ProcessConsole<'a, COMMAND_HISTORY_LEN, A, C> { ProcessConsole { - uart: uart, - alarm: alarm, + uart, + alarm, process_printer, tx_in_progress: Cell::new(false), tx_buffer: TakeCell::new(tx_buffer), @@ -468,10 +468,10 @@ impl<'a, const COMMAND_HISTORY_LEN: usize, A: Alarm<'a>, C: ProcessManagementCap cursor: Cell::new(0), previous_byte: Cell::new(EOL), execute: Cell::new(false), - kernel: kernel, - kernel_addresses: kernel_addresses, - reset_function: reset_function, - capability: capability, + kernel, + kernel_addresses, + reset_function, + capability, } } @@ -678,7 +678,7 @@ impl<'a, const COMMAND_HISTORY_LEN: usize, A: Alarm<'a>, C: ProcessManagementCap if new_context.is_some() { self.writer_state.replace(WriterState::ProcessPrint { - process_id: process_id, + process_id, context: new_context, }); } else { @@ -966,7 +966,7 @@ impl<'a, const COMMAND_HISTORY_LEN: usize, A: Alarm<'a>, C: ProcessManagementCap self.writer_state.replace( WriterState::ProcessPrint { process_id: proc.processid(), - context: context, + context, }, ); } diff --git a/capsules/core/src/rng.rs b/capsules/core/src/rng.rs index ce378b3d52..02acfb12b2 100644 --- a/capsules/core/src/rng.rs +++ b/capsules/core/src/rng.rs @@ -65,7 +65,7 @@ impl<'a, R: Rng<'a>> RngDriver<'a, R> { grant: Grant, AllowRoCount<0>, AllowRwCount<{ rw_allow::COUNT }>>, ) -> Self { Self { - rng: rng, + rng, apps: grant, getting_randomness: Cell::new(false), } @@ -225,7 +225,7 @@ pub struct Entropy32ToRandom<'a, E: Entropy32<'a>> { impl<'a, E: Entropy32<'a>> Entropy32ToRandom<'a, E> { pub fn new(egen: &'a E) -> Self { Self { - egen: egen, + egen, client: OptionalCell::empty(), } } @@ -288,7 +288,7 @@ pub struct Entropy8To32<'a, E: Entropy8<'a>> { impl<'a, E: Entropy8<'a>> Entropy8To32<'a, E> { pub fn new(egen: &'a E) -> Self { Self { - egen: egen, + egen, client: OptionalCell::empty(), count: Cell::new(0), bytes: Cell::new(0), @@ -384,7 +384,7 @@ pub struct Entropy32To8<'a, E: Entropy32<'a>> { impl<'a, E: Entropy32<'a>> Entropy32To8<'a, E> { pub fn new(egen: &'a E) -> Self { Self { - egen: egen, + egen, client: OptionalCell::empty(), entropy: Cell::new(0), bytes_consumed: Cell::new(0), @@ -469,7 +469,7 @@ pub struct SynchronousRandom<'a, R: Rng<'a>> { impl<'a, R: Rng<'a>> SynchronousRandom<'a, R> { fn new(rgen: &'a R) -> Self { Self { - rgen: rgen, + rgen, seed: Cell::new(0), } } diff --git a/capsules/core/src/spi_controller.rs b/capsules/core/src/spi_controller.rs index a2abe0ba7f..013618c5ae 100644 --- a/capsules/core/src/spi_controller.rs +++ b/capsules/core/src/spi_controller.rs @@ -87,7 +87,7 @@ impl<'a, S: SpiMasterDevice<'a>> Spi<'a, S> { >, ) -> Spi<'a, S> { Spi { - spi_master: spi_master, + spi_master, busy: Cell::new(false), kernel_len: Cell::new(0), kernel_read: TakeCell::empty(), diff --git a/capsules/core/src/spi_peripheral.rs b/capsules/core/src/spi_peripheral.rs index 6b12127a93..2be244922f 100644 --- a/capsules/core/src/spi_peripheral.rs +++ b/capsules/core/src/spi_peripheral.rs @@ -74,7 +74,7 @@ impl<'a, S: SpiSlaveDevice<'a>> SpiPeripheral<'a, S> { >, ) -> SpiPeripheral<'a, S> { SpiPeripheral { - spi_slave: spi_slave, + spi_slave, busy: Cell::new(false), kernel_len: Cell::new(0), kernel_read: TakeCell::empty(), diff --git a/capsules/core/src/test/alarm.rs b/capsules/core/src/test/alarm.rs index 86f44dee70..3b94c2c5bb 100644 --- a/capsules/core/src/test/alarm.rs +++ b/capsules/core/src/test/alarm.rs @@ -19,7 +19,7 @@ pub struct TestAlarm<'a, A: Alarm<'a>> { impl<'a, A: Alarm<'a>> TestAlarm<'a, A> { pub fn new(alarm: &'a A) -> TestAlarm<'a, A> { TestAlarm { - alarm: alarm, + alarm, ms: Cell::new(0), } } diff --git a/capsules/core/src/test/alarm_edge_cases.rs b/capsules/core/src/test/alarm_edge_cases.rs index e30674fcb8..08a6926aee 100644 --- a/capsules/core/src/test/alarm_edge_cases.rs +++ b/capsules/core/src/test/alarm_edge_cases.rs @@ -21,7 +21,7 @@ pub struct TestAlarmEdgeCases<'a, A: 'a> { impl<'a, A: Alarm<'a>> TestAlarmEdgeCases<'a, A> { pub fn new(alarm: &'a A) -> TestAlarmEdgeCases<'a, A> { TestAlarmEdgeCases { - alarm: alarm, + alarm, counter: Cell::new(0), alarms: [ 100, 200, 25, 25, 25, 25, 500, 0, 448, 15, 19, 1, 0, 33, 5, 1000, 27, 1, 0, 1, diff --git a/capsules/core/src/test/random_alarm.rs b/capsules/core/src/test/random_alarm.rs index 31ec6a9204..a704cf6c1a 100644 --- a/capsules/core/src/test/random_alarm.rs +++ b/capsules/core/src/test/random_alarm.rs @@ -25,7 +25,7 @@ pub struct TestRandomAlarm<'a, A: Alarm<'a>> { impl<'a, A: Alarm<'a>> TestRandomAlarm<'a, A> { pub fn new(alarm: &'a A, value: usize, ch: char, print_output: bool) -> TestRandomAlarm<'a, A> { TestRandomAlarm { - alarm: alarm, + alarm, counter: Cell::new(value), expected: Cell::new(alarm.ticks_from_seconds(0)), _id: ch, diff --git a/capsules/core/src/test/random_timer.rs b/capsules/core/src/test/random_timer.rs index f77d3b0909..e424c73014 100644 --- a/capsules/core/src/test/random_timer.rs +++ b/capsules/core/src/test/random_timer.rs @@ -26,7 +26,7 @@ pub struct TestRandomTimer<'a, T: 'a> { impl<'a, T: Timer<'a>> TestRandomTimer<'a, T> { pub fn new(timer: &'a T, value: usize, ch: char) -> TestRandomTimer<'a, T> { TestRandomTimer { - timer: timer, + timer, interval: Cell::new(0), counter: Cell::new(0), iv: Cell::new(value as u32), diff --git a/capsules/core/src/test/rng.rs b/capsules/core/src/test/rng.rs index 36e27578e4..4c10f9fab8 100644 --- a/capsules/core/src/test/rng.rs +++ b/capsules/core/src/test/rng.rs @@ -24,7 +24,7 @@ pub struct TestRandom<'a> { impl<'a> TestRandom<'a> { pub fn new(random: &'a dyn rng::Random<'a>) -> TestRandom<'a> { - TestRandom { random: random } + TestRandom { random } } pub fn run(&self) { @@ -46,7 +46,7 @@ pub struct TestRng<'a> { impl<'a> TestRng<'a> { pub fn new(rng: &'a dyn rng::Rng<'a>) -> TestRng<'a> { TestRng { - rng: rng, + rng, pool: Cell::new([0xeeeeeeee; ELEMENTS]), count: Cell::new(0), } @@ -109,7 +109,7 @@ pub struct TestEntropy32<'a> { impl<'a> TestEntropy32<'a> { pub fn new(egen: &'a dyn entropy::Entropy32<'a>) -> TestEntropy32<'a> { TestEntropy32 { - egen: egen, + egen, pool: Cell::new([0xeeeeeeee; ELEMENTS]), count: Cell::new(0), } @@ -172,7 +172,7 @@ pub struct TestEntropy8<'a> { impl<'a> TestEntropy8<'a> { pub fn new(egen: &'a dyn entropy::Entropy8<'a>) -> TestEntropy8<'a> { TestEntropy8 { - egen: egen, + egen, pool: Cell::new([0xee; ELEMENTS]), count: Cell::new(0), } diff --git a/capsules/core/src/test/virtual_rng.rs b/capsules/core/src/test/virtual_rng.rs index bf1a0a5a20..2f8518c1a8 100644 --- a/capsules/core/src/test/virtual_rng.rs +++ b/capsules/core/src/test/virtual_rng.rs @@ -26,8 +26,8 @@ pub struct TestRng<'a> { impl<'a> TestRng<'a> { pub fn new(device_id: usize, device: &'a VirtualRngMasterDevice<'a>) -> TestRng<'a> { TestRng { - device_id: device_id, - device: device, + device_id, + device, num_requests: Cell::new(NUM_REQUESTS), } } diff --git a/capsules/core/src/test/virtual_uart.rs b/capsules/core/src/test/virtual_uart.rs index 3b14902a4b..9d533b1948 100644 --- a/capsules/core/src/test/virtual_uart.rs +++ b/capsules/core/src/test/virtual_uart.rs @@ -20,7 +20,7 @@ pub struct TestVirtualUartReceive { impl TestVirtualUartReceive { pub fn new(device: &'static UartDevice<'static>, buffer: &'static mut [u8]) -> Self { TestVirtualUartReceive { - device: device, + device, buffer: TakeCell::new(buffer), } } diff --git a/capsules/core/src/virtualizers/virtual_adc.rs b/capsules/core/src/virtualizers/virtual_adc.rs index 38dcb12926..4ae33aac9e 100644 --- a/capsules/core/src/virtualizers/virtual_adc.rs +++ b/capsules/core/src/virtualizers/virtual_adc.rs @@ -38,7 +38,7 @@ impl<'a, A: hil::adc::Adc<'a>> hil::adc::Client for MuxAdc<'a, A> { impl<'a, A: hil::adc::Adc<'a>> MuxAdc<'a, A> { pub const fn new(adc: &'a A) -> MuxAdc<'a, A> { MuxAdc { - adc: adc, + adc, devices: List::new(), inflight: OptionalCell::empty(), } @@ -89,8 +89,8 @@ pub struct AdcDevice<'a, A: hil::adc::Adc<'a>> { impl<'a, A: hil::adc::Adc<'a>> AdcDevice<'a, A> { pub const fn new(mux: &'a MuxAdc<'a, A>, channel: A::Channel) -> AdcDevice<'a, A> { let adc_user = AdcDevice { - mux: mux, - channel: channel, + mux, + channel, operation: OptionalCell::empty(), next: ListLink::empty(), client: OptionalCell::empty(), diff --git a/capsules/core/src/virtualizers/virtual_aes_ccm.rs b/capsules/core/src/virtualizers/virtual_aes_ccm.rs index d1533f65ef..2024a3b099 100644 --- a/capsules/core/src/virtualizers/virtual_aes_ccm.rs +++ b/capsules/core/src/virtualizers/virtual_aes_ccm.rs @@ -124,13 +124,13 @@ impl CryptFunctionParameters { encrypting: bool, ) -> CryptFunctionParameters { CryptFunctionParameters { - buf: buf, - a_off: a_off, - m_off: m_off, - m_len: m_len, - mic_len: mic_len, - confidential: confidential, - encrypting: encrypting, + buf, + a_off, + m_off, + m_len, + mic_len, + confidential, + encrypting, } } } @@ -259,7 +259,7 @@ impl<'a, A: AES128<'a> + AES128Ctr + AES128CBC + AES128ECB> VirtualAES128CCM<'a, crypt_buf: &'static mut [u8], ) -> VirtualAES128CCM<'a, A> { VirtualAES128CCM { - mux: mux, + mux, aes: mux.aes, next: ListLink::empty(), crypt_buf: TakeCell::new(crypt_buf), diff --git a/capsules/core/src/virtualizers/virtual_alarm.rs b/capsules/core/src/virtualizers/virtual_alarm.rs index e927a11bcc..70581e8f53 100644 --- a/capsules/core/src/virtualizers/virtual_alarm.rs +++ b/capsules/core/src/virtualizers/virtual_alarm.rs @@ -217,7 +217,7 @@ impl<'a, A: Alarm<'a>> MuxAlarm<'a, A> { MuxAlarm { virtual_alarms: List::new(), enabled: Cell::new(0), - alarm: alarm, + alarm, firing: Cell::new(false), next_tick_vals: Cell::new(None), } diff --git a/capsules/core/src/virtualizers/virtual_flash.rs b/capsules/core/src/virtualizers/virtual_flash.rs index 26e4b4c3b0..610a9ad21d 100644 --- a/capsules/core/src/virtualizers/virtual_flash.rs +++ b/capsules/core/src/virtualizers/virtual_flash.rs @@ -80,7 +80,7 @@ impl hil::flash::Client for MuxFlash<'_, F> { impl<'a, F: hil::flash::Flash> MuxFlash<'a, F> { pub const fn new(flash: &'a F) -> MuxFlash<'a, F> { MuxFlash { - flash: flash, + flash, users: List::new(), inflight: OptionalCell::empty(), } @@ -154,7 +154,7 @@ pub struct FlashUser<'a, F: hil::flash::Flash + 'static> { impl<'a, F: hil::flash::Flash> FlashUser<'a, F> { pub fn new(mux: &'a MuxFlash<'a, F>) -> FlashUser<'a, F> { FlashUser { - mux: mux, + mux, buffer: TakeCell::empty(), operation: Cell::new(Op::Idle), next: ListLink::empty(), diff --git a/capsules/core/src/virtualizers/virtual_i2c.rs b/capsules/core/src/virtualizers/virtual_i2c.rs index 5385926e36..ed310f7a34 100644 --- a/capsules/core/src/virtualizers/virtual_i2c.rs +++ b/capsules/core/src/virtualizers/virtual_i2c.rs @@ -216,8 +216,8 @@ pub struct I2CDevice<'a, I: i2c::I2CMaster<'a>, S: i2c::SMBusMaster<'a> = NoSMBu impl<'a, I: i2c::I2CMaster<'a>, S: i2c::SMBusMaster<'a>> I2CDevice<'a, I, S> { pub fn new(mux: &'a MuxI2C<'a, I, S>, addr: u8) -> I2CDevice<'a, I, S> { I2CDevice { - mux: mux, - addr: addr, + mux, + addr, enabled: Cell::new(false), buffer: TakeCell::empty(), operation: Cell::new(Op::Idle), @@ -323,8 +323,8 @@ impl<'a, I: i2c::I2CMaster<'a>, S: i2c::SMBusMaster<'a>> SMBusDevice<'a, I, S> { } SMBusDevice { - mux: mux, - addr: addr, + mux, + addr, enabled: Cell::new(false), buffer: TakeCell::empty(), operation: Cell::new(Op::Idle), diff --git a/capsules/core/src/virtualizers/virtual_pwm.rs b/capsules/core/src/virtualizers/virtual_pwm.rs index e1c4d68514..e5734191f3 100644 --- a/capsules/core/src/virtualizers/virtual_pwm.rs +++ b/capsules/core/src/virtualizers/virtual_pwm.rs @@ -38,7 +38,7 @@ pub struct MuxPwm<'a, P: hil::pwm::Pwm> { impl<'a, P: hil::pwm::Pwm> MuxPwm<'a, P> { pub const fn new(pwm: &'a P) -> MuxPwm<'a, P> { MuxPwm { - pwm: pwm, + pwm, devices: List::new(), inflight: OptionalCell::empty(), } @@ -118,8 +118,8 @@ pub struct PwmPinUser<'a, P: hil::pwm::Pwm> { impl<'a, P: hil::pwm::Pwm> PwmPinUser<'a, P> { pub const fn new(mux: &'a MuxPwm<'a, P>, pin: P::Pin) -> PwmPinUser<'a, P> { PwmPinUser { - mux: mux, - pin: pin, + mux, + pin, operation: OptionalCell::empty(), next: ListLink::empty(), } diff --git a/capsules/core/src/virtualizers/virtual_rng.rs b/capsules/core/src/virtualizers/virtual_rng.rs index ee845854ad..156dc482fe 100644 --- a/capsules/core/src/virtualizers/virtual_rng.rs +++ b/capsules/core/src/virtualizers/virtual_rng.rs @@ -25,7 +25,7 @@ pub struct MuxRngMaster<'a> { impl<'a> MuxRngMaster<'a> { pub const fn new(rng: &'a dyn Rng<'a>) -> MuxRngMaster<'a> { MuxRngMaster { - rng: rng, + rng, devices: List::new(), inflight: OptionalCell::empty(), } @@ -110,7 +110,7 @@ impl<'a> ListNode<'a, VirtualRngMasterDevice<'a>> for VirtualRngMasterDevice<'a> impl<'a> VirtualRngMasterDevice<'a> { pub const fn new(mux: &'a MuxRngMaster<'a>) -> VirtualRngMasterDevice<'a> { VirtualRngMasterDevice { - mux: mux, + mux, next: ListLink::empty(), client: OptionalCell::empty(), operation: Cell::new(Op::Idle), diff --git a/capsules/core/src/virtualizers/virtual_spi.rs b/capsules/core/src/virtualizers/virtual_spi.rs index b2955b3aef..68ca833b9d 100644 --- a/capsules/core/src/virtualizers/virtual_spi.rs +++ b/capsules/core/src/virtualizers/virtual_spi.rs @@ -183,9 +183,9 @@ impl<'a, Spi: hil::spi::SpiMaster<'a>> VirtualSpiMasterDevice<'a, Spi> { chip_select: Spi::ChipSelect, ) -> VirtualSpiMasterDevice<'a, Spi> { VirtualSpiMasterDevice { - mux: mux, + mux, configuration: Cell::new(SpiConfiguration { - chip_select: chip_select, + chip_select, polarity: hil::spi::ClockPolarity::IdleLow, phase: hil::spi::ClockPhase::SampleLeading, rate: 100_000, @@ -324,7 +324,7 @@ pub struct SpiSlaveDevice<'a, Spi: hil::spi::SpiSlave<'a>> { impl<'a, Spi: hil::spi::SpiSlave<'a>> SpiSlaveDevice<'a, Spi> { pub const fn new(spi: &'a Spi) -> SpiSlaveDevice<'a, Spi> { SpiSlaveDevice { - spi: spi, + spi, client: OptionalCell::empty(), } } diff --git a/capsules/core/src/virtualizers/virtual_timer.rs b/capsules/core/src/virtualizers/virtual_timer.rs index e86eac5cb5..bfe12680be 100644 --- a/capsules/core/src/virtualizers/virtual_timer.rs +++ b/capsules/core/src/virtualizers/virtual_timer.rs @@ -197,7 +197,7 @@ impl<'a, A: Alarm<'a>> MuxTimer<'a, A> { MuxTimer { timers: List::new(), enabled: Cell::new(0), - alarm: alarm, + alarm, } } diff --git a/capsules/core/src/virtualizers/virtual_uart.rs b/capsules/core/src/virtualizers/virtual_uart.rs index 4bd38a897a..46b84413b5 100644 --- a/capsules/core/src/virtualizers/virtual_uart.rs +++ b/capsules/core/src/virtualizers/virtual_uart.rs @@ -355,8 +355,8 @@ impl<'a> UartDevice<'a> { pub fn new(mux: &'a MuxUart<'a>, receiver: bool) -> UartDevice<'a> { UartDevice { state: Cell::new(UartDeviceReceiveState::Idle), - mux: mux, - receiver: receiver, + mux, + receiver, tx_buffer: TakeCell::empty(), transmitting: Cell::new(false), rx_buffer: TakeCell::empty(), @@ -449,7 +449,7 @@ impl<'a> uart::Transmit<'a> for UartDevice<'a> { Err(ErrorCode::BUSY) } else { self.transmitting.set(true); - self.operation.set(Operation::TransmitWord { word: word }); + self.operation.set(Operation::TransmitWord { word }); self.mux.do_next_op_async(); Ok(()) } diff --git a/capsules/extra/src/air_quality.rs b/capsules/extra/src/air_quality.rs index 81fc5f443c..974a0c0a78 100644 --- a/capsules/extra/src/air_quality.rs +++ b/capsules/extra/src/air_quality.rs @@ -58,7 +58,7 @@ impl<'a> AirQualitySensor<'a> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> AirQualitySensor<'a> { AirQualitySensor { - driver: driver, + driver, apps: grant, busy: Cell::new(false), } diff --git a/capsules/extra/src/ambient_light.rs b/capsules/extra/src/ambient_light.rs index b00025263b..e6961ec3b1 100644 --- a/capsules/extra/src/ambient_light.rs +++ b/capsules/extra/src/ambient_light.rs @@ -56,7 +56,7 @@ impl<'a> AmbientLight<'a> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> AmbientLight { AmbientLight { - sensor: sensor, + sensor, command_pending: Cell::new(false), apps: grant, } diff --git a/capsules/extra/src/analog_sensor.rs b/capsules/extra/src/analog_sensor.rs index a3096fec86..1c07586fc0 100644 --- a/capsules/extra/src/analog_sensor.rs +++ b/capsules/extra/src/analog_sensor.rs @@ -33,9 +33,9 @@ impl<'a, A: hil::adc::Adc<'a>> AnalogLightSensor<'a, A> { sensor_type: AnalogLightSensorType, ) -> AnalogLightSensor<'a, A> { AnalogLightSensor { - adc: adc, - channel: channel, - sensor_type: sensor_type, + adc, + channel, + sensor_type, client: OptionalCell::empty(), } } @@ -85,9 +85,9 @@ impl<'a, A: hil::adc::Adc<'a>> AnalogTemperatureSensor<'a, A> { sensor_type: AnalogLightSensorType, ) -> AnalogLightSensor<'a, A> { AnalogLightSensor { - adc: adc, - channel: channel, - sensor_type: sensor_type, + adc, + channel, + sensor_type, client: OptionalCell::empty(), } } diff --git a/capsules/extra/src/apds9960.rs b/capsules/extra/src/apds9960.rs index 8edb99c1ef..191be9c3b0 100644 --- a/capsules/extra/src/apds9960.rs +++ b/capsules/extra/src/apds9960.rs @@ -126,8 +126,8 @@ impl<'a, I: i2c::I2CDevice> APDS9960<'a, I> { ) -> APDS9960<'a, I> { // setup and return struct APDS9960 { - i2c: i2c, - interrupt_pin: interrupt_pin, + i2c, + interrupt_pin, prox_callback: OptionalCell::empty(), state: Cell::new(State::Idle), buffer: TakeCell::new(buffer), diff --git a/capsules/extra/src/app_flash_driver.rs b/capsules/extra/src/app_flash_driver.rs index 4cacbad7c4..0ddeae7800 100644 --- a/capsules/extra/src/app_flash_driver.rs +++ b/capsules/extra/src/app_flash_driver.rs @@ -85,7 +85,7 @@ impl<'a> AppFlash<'a> { buffer: &'static mut [u8], ) -> AppFlash<'a> { AppFlash { - driver: driver, + driver, apps: grant, current_app: OptionalCell::empty(), buffer: TakeCell::new(buffer), diff --git a/capsules/extra/src/ble_advertising_driver.rs b/capsules/extra/src/ble_advertising_driver.rs index d13baf1013..106a7811bd 100644 --- a/capsules/extra/src/ble_advertising_driver.rs +++ b/capsules/extra/src/ble_advertising_driver.rs @@ -358,11 +358,11 @@ where alarm: &'a A, ) -> BLE<'a, B, A> { BLE { - radio: radio, + radio, busy: Cell::new(false), app: container, kernel_tx: kernel::utilities::cells::TakeCell::new(tx_buf), - alarm: alarm, + alarm, sending_app: OptionalCell::empty(), receiving_app: OptionalCell::empty(), } diff --git a/capsules/extra/src/bmm150.rs b/capsules/extra/src/bmm150.rs index 589e45a0ff..d7cb5f1238 100644 --- a/capsules/extra/src/bmm150.rs +++ b/capsules/extra/src/bmm150.rs @@ -76,7 +76,7 @@ impl<'a, I: I2CDevice> BMM150<'a, I> { pub fn new(buffer: &'static mut [u8], i2c: &'a I) -> BMM150<'a, I> { BMM150 { buffer: TakeCell::new(buffer), - i2c: i2c, + i2c, ninedof_client: OptionalCell::empty(), state: Cell::new(State::Suspend), } diff --git a/capsules/extra/src/bmp280.rs b/capsules/extra/src/bmp280.rs index a8a6d76736..f3b7ffcd53 100644 --- a/capsules/extra/src/bmp280.rs +++ b/capsules/extra/src/bmp280.rs @@ -201,7 +201,7 @@ impl<'a, A: Alarm<'a>, I: i2c::I2CDevice> Bmp280<'a, A, I> { temperature_client: OptionalCell::empty(), state: Cell::new(State::Uninitialized), buffer: TakeCell::new(buffer), - alarm: alarm, + alarm, } } diff --git a/capsules/extra/src/bus.rs b/capsules/extra/src/bus.rs index 613dbed012..9a9203cde9 100644 --- a/capsules/extra/src/bus.rs +++ b/capsules/extra/src/bus.rs @@ -391,7 +391,7 @@ pub struct Bus8080Bus<'a, B: Bus8080<'static>> { impl<'a, B: Bus8080<'static>> Bus8080Bus<'a, B> { pub fn new(bus: &'a B) -> Bus8080Bus<'a, B> { Bus8080Bus { - bus: bus, + bus, client: OptionalCell::empty(), status: Cell::new(BusStatus::Idle), } diff --git a/capsules/extra/src/buzzer_driver.rs b/capsules/extra/src/buzzer_driver.rs index a31b0b5d20..4ee820373a 100644 --- a/capsules/extra/src/buzzer_driver.rs +++ b/capsules/extra/src/buzzer_driver.rs @@ -110,10 +110,10 @@ impl<'a, B: hil::buzzer::Buzzer<'a>> Buzzer<'a, B> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> Buzzer<'a, B> { Buzzer { - buzzer: buzzer, + buzzer, apps: grant, active_app: OptionalCell::empty(), - max_duration_ms: max_duration_ms, + max_duration_ms, } } diff --git a/capsules/extra/src/buzzer_pwm.rs b/capsules/extra/src/buzzer_pwm.rs index 7d6f0192bb..cab929fc1a 100644 --- a/capsules/extra/src/buzzer_pwm.rs +++ b/capsules/extra/src/buzzer_pwm.rs @@ -75,10 +75,10 @@ pub struct PwmBuzzer<'a, A: hil::time::Alarm<'a>, P: hil::pwm::PwmPin> { impl<'a, A: hil::time::Alarm<'a>, P: hil::pwm::PwmPin> PwmBuzzer<'a, A, P> { pub fn new(pwm_pin: &'a P, alarm: &'a A, max_duration_ms: usize) -> PwmBuzzer<'a, A, P> { PwmBuzzer { - pwm_pin: pwm_pin, - alarm: alarm, + pwm_pin, + alarm, client: OptionalCell::empty(), - max_duration_ms: max_duration_ms, + max_duration_ms, } } } diff --git a/capsules/extra/src/dac.rs b/capsules/extra/src/dac.rs index f9d093a1cf..f6df436a70 100644 --- a/capsules/extra/src/dac.rs +++ b/capsules/extra/src/dac.rs @@ -29,7 +29,7 @@ pub struct Dac<'a> { impl<'a> Dac<'a> { pub fn new(dac: &'a dyn hil::dac::DacChannel) -> Dac<'a> { - Dac { dac: dac } + Dac { dac } } } diff --git a/capsules/extra/src/debug_process_restart.rs b/capsules/extra/src/debug_process_restart.rs index b435be42dd..ea3da9bc5e 100644 --- a/capsules/extra/src/debug_process_restart.rs +++ b/capsules/extra/src/debug_process_restart.rs @@ -55,7 +55,7 @@ impl<'a, C: ProcessManagementCapability> DebugProcessRestart<'a, C> { pin.enable_interrupts(gpio::InterruptEdge::EitherEdge); DebugProcessRestart { - kernel: kernel, + kernel, capability: cap, pin, mode, diff --git a/capsules/extra/src/eui64.rs b/capsules/extra/src/eui64.rs index a6d099b052..b9b3c24570 100644 --- a/capsules/extra/src/eui64.rs +++ b/capsules/extra/src/eui64.rs @@ -16,7 +16,7 @@ pub struct Eui64 { impl Eui64 { pub fn new(eui64: u64) -> Eui64 { - Eui64 { eui64: eui64 } + Eui64 { eui64 } } } diff --git a/capsules/extra/src/fm25cl.rs b/capsules/extra/src/fm25cl.rs index b868087b28..6b66043c27 100644 --- a/capsules/extra/src/fm25cl.rs +++ b/capsules/extra/src/fm25cl.rs @@ -109,7 +109,7 @@ impl<'a, S: hil::spi::SpiMasterDevice<'a>> FM25CL<'a, S> { ) -> FM25CL<'a, S> { // setup and return struct FM25CL { - spi: spi, + spi, state: Cell::new(State::Idle), txbuffer: TakeCell::new(txbuffer), rxbuffer: TakeCell::new(rxbuffer), diff --git a/capsules/extra/src/ft6x06.rs b/capsules/extra/src/ft6x06.rs index 0631da4a22..9c328e01bf 100644 --- a/capsules/extra/src/ft6x06.rs +++ b/capsules/extra/src/ft6x06.rs @@ -71,8 +71,8 @@ impl<'a, I: i2c::I2CDevice> Ft6x06<'a, I> { // setup and return struct interrupt_pin.enable_interrupts(gpio::InterruptEdge::FallingEdge); Ft6x06 { - i2c: i2c, - interrupt_pin: interrupt_pin, + i2c, + interrupt_pin, touch_client: OptionalCell::empty(), gesture_client: OptionalCell::empty(), multi_touch_client: OptionalCell::empty(), diff --git a/capsules/extra/src/fxos8700cq.rs b/capsules/extra/src/fxos8700cq.rs index df314c8d01..025f117028 100644 --- a/capsules/extra/src/fxos8700cq.rs +++ b/capsules/extra/src/fxos8700cq.rs @@ -196,8 +196,8 @@ impl<'a> Fxos8700cq<'a> { buffer: &'static mut [u8], ) -> Fxos8700cq<'a> { Fxos8700cq { - i2c: i2c, - interrupt_pin1: interrupt_pin1, + i2c, + interrupt_pin1, state: Cell::new(State::Disabled), buffer: TakeCell::new(buffer), callback: OptionalCell::empty(), diff --git a/capsules/extra/src/hd44780.rs b/capsules/extra/src/hd44780.rs index a3c49fedc4..8b125d6f79 100644 --- a/capsules/extra/src/hd44780.rs +++ b/capsules/extra/src/hd44780.rs @@ -170,12 +170,12 @@ impl<'a, A: Alarm<'a>> HD44780<'a, A> { data_6_pin.make_output(); data_7_pin.make_output(); let hd44780 = HD44780 { - rs_pin: rs_pin, - en_pin: en_pin, - data_4_pin: data_4_pin, - data_5_pin: data_5_pin, - data_6_pin: data_6_pin, - data_7_pin: data_7_pin, + rs_pin, + en_pin, + data_4_pin, + data_5_pin, + data_6_pin, + data_7_pin, width: Cell::new(width), height: Cell::new(height), display_function: Cell::new(LCD_4BITMODE | LCD_1LINE | LCD_5X8DOTS), @@ -183,7 +183,7 @@ impl<'a, A: Alarm<'a>> HD44780<'a, A> { display_mode: Cell::new(0), num_lines: Cell::new(0), row_offsets: TakeCell::new(row_offsets), - alarm: alarm, + alarm, lcd_status: Cell::new(LCDStatus::Idle), lcd_after_pulse_status: Cell::new(LCDStatus::Idle), lcd_after_command_status: Cell::new(LCDStatus::Idle), diff --git a/capsules/extra/src/hmac.rs b/capsules/extra/src/hmac.rs index fb34322fa3..a05e878fa4 100644 --- a/capsules/extra/src/hmac.rs +++ b/capsules/extra/src/hmac.rs @@ -106,7 +106,7 @@ impl< >, ) -> HmacDriver<'a, H, L> { HmacDriver { - hmac: hmac, + hmac, active: Cell::new(false), apps: grant, processid: OptionalCell::empty(), diff --git a/capsules/extra/src/humidity.rs b/capsules/extra/src/humidity.rs index e3b2ef46da..5d15f4e027 100644 --- a/capsules/extra/src/humidity.rs +++ b/capsules/extra/src/humidity.rs @@ -85,7 +85,7 @@ impl<'a, H: hil::sensors::HumidityDriver<'a>> HumiditySensor<'a, H> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> HumiditySensor<'a, H> { HumiditySensor { - driver: driver, + driver, apps: grant, busy: Cell::new(false), } diff --git a/capsules/extra/src/ieee802154/driver.rs b/capsules/extra/src/ieee802154/driver.rs index 7ef11aafd3..a0bbf0db3d 100644 --- a/capsules/extra/src/ieee802154/driver.rs +++ b/capsules/extra/src/ieee802154/driver.rs @@ -214,14 +214,7 @@ impl KeyDescriptor { let (_, key_id) = dec_try!(buf, 1; decode_key_id); let mut key = [0u8; 16]; let off = dec_consume!(buf, 11; decode_bytes, &mut key); - stream_done!( - off, - KeyDescriptor { - level: level, - key_id: key_id, - key: key, - } - ); + stream_done!(off, KeyDescriptor { level, key_id, key }); } } diff --git a/capsules/extra/src/ieee802154/framer.rs b/capsules/extra/src/ieee802154/framer.rs index 50ba2b81be..b5a8674bea 100644 --- a/capsules/extra/src/ieee802154/framer.rs +++ b/capsules/extra/src/ieee802154/framer.rs @@ -351,8 +351,8 @@ impl<'a, M: Mac<'a>, A: AES128CCM<'a>> Framer<'a, M, A> { crypt_buf: SubSliceMut<'static, u8>, ) -> Framer<'a, M, A> { Framer { - mac: mac, - aes_ccm: aes_ccm, + mac, + aes_ccm, data_sequence: Cell::new(0), key_procedure: OptionalCell::empty(), device_procedure: OptionalCell::empty(), @@ -489,10 +489,10 @@ impl<'a, M: Mac<'a>, A: AES128CCM<'a>> Framer<'a, M, A> { Some(FrameInfo { frame_type: header.frame_type, - mac_payload_offset: mac_payload_offset, - data_offset: data_offset, - data_len: data_len, - mic_len: mic_len, + mac_payload_offset, + data_offset, + data_len, + mic_len, security_params: Some((security.level, key, nonce)), }) } @@ -800,10 +800,10 @@ impl<'a, M: Mac<'a>, A: AES128CCM<'a>> MacDevice<'a> for Framer<'a, M, A> { let nonce = get_ccm_nonce(&src_addr_long, frame_counter, level); ( Security { - level: level, + level, asn_in_nonce: false, frame_counter: Some(frame_counter), - key_id: key_id, + key_id, }, key, nonce, @@ -831,7 +831,7 @@ impl<'a, M: Mac<'a>, A: AES128CCM<'a>> MacDevice<'a> for Framer<'a, M, A> { dst_addr: Some(dst_addr), src_pan: Some(src_pan), src_addr: Some(src_addr), - security: security, + security, header_ies: Default::default(), header_ies_len: 0, payload_ies: Default::default(), @@ -840,13 +840,13 @@ impl<'a, M: Mac<'a>, A: AES128CCM<'a>> MacDevice<'a> for Framer<'a, M, A> { match header.encode(buf, true).done() { Some((data_offset, mac_payload_offset)) => Ok(Frame { - buf: buf, + buf, info: FrameInfo { frame_type: FrameType::Data, - mac_payload_offset: mac_payload_offset, - data_offset: data_offset, + mac_payload_offset, + data_offset, data_len: 0, - mic_len: mic_len, + mic_len, security_params: security_desc.map(|(sec, key, nonce)| (sec.level, key, nonce)), }, }), diff --git a/capsules/extra/src/ieee802154/mac.rs b/capsules/extra/src/ieee802154/mac.rs index 3321dee4d0..d3aeef207c 100644 --- a/capsules/extra/src/ieee802154/mac.rs +++ b/capsules/extra/src/ieee802154/mac.rs @@ -79,7 +79,7 @@ pub struct AwakeMac<'a, R: radio::Radio<'a>> { impl<'a, R: radio::Radio<'a>> AwakeMac<'a, R> { pub fn new(radio: &'a R) -> AwakeMac<'a, R> { AwakeMac { - radio: radio, + radio, tx_client: OptionalCell::empty(), rx_client: OptionalCell::empty(), } diff --git a/capsules/extra/src/ieee802154/virtual_mac.rs b/capsules/extra/src/ieee802154/virtual_mac.rs index a4284e8375..84aa009eb7 100644 --- a/capsules/extra/src/ieee802154/virtual_mac.rs +++ b/capsules/extra/src/ieee802154/virtual_mac.rs @@ -75,7 +75,7 @@ impl<'a, M: device::MacDevice<'a>> device::RxClient for MuxMac<'a, M> { impl<'a, M: device::MacDevice<'a>> MuxMac<'a, M> { pub const fn new(mac: &'a M) -> MuxMac<'a, M> { MuxMac { - mac: mac, + mac, users: List::new(), inflight: OptionalCell::empty(), } @@ -208,7 +208,7 @@ pub struct MacUser<'a, M: device::MacDevice<'a>> { impl<'a, M: device::MacDevice<'a>> MacUser<'a, M> { pub const fn new(mux: &'a MuxMac<'a, M>) -> Self { Self { - mux: mux, + mux, operation: MapCell::new(Op::Idle), next: ListLink::empty(), tx_client: OptionalCell::empty(), diff --git a/capsules/extra/src/ieee802154/xmac.rs b/capsules/extra/src/ieee802154/xmac.rs index 1ecba9f0b8..eb2cf0504b 100644 --- a/capsules/extra/src/ieee802154/xmac.rs +++ b/capsules/extra/src/ieee802154/xmac.rs @@ -176,9 +176,9 @@ impl<'a, R: radio::Radio<'a>, A: Alarm<'a>> XMac<'a, R, A> { mac_buf: &'static mut [u8], ) -> XMac<'a, R, A> { XMac { - radio: radio, - alarm: alarm, - rng: rng, + radio, + alarm, + rng, tx_client: OptionalCell::empty(), rx_client: OptionalCell::empty(), state: Cell::new(XMacState::STARTUP), diff --git a/capsules/extra/src/isl29035.rs b/capsules/extra/src/isl29035.rs index da576c5cd8..87ff0ffe16 100644 --- a/capsules/extra/src/isl29035.rs +++ b/capsules/extra/src/isl29035.rs @@ -64,8 +64,8 @@ pub struct Isl29035<'a, A: time::Alarm<'a>> { impl<'a, A: time::Alarm<'a>> Isl29035<'a, A> { pub fn new(i2c: &'a dyn I2CDevice, alarm: &'a A, buffer: &'static mut [u8]) -> Isl29035<'a, A> { Isl29035 { - i2c: i2c, - alarm: alarm, + i2c, + alarm, state: Cell::new(State::Disabled), buffer: TakeCell::new(buffer), client: OptionalCell::empty(), diff --git a/capsules/extra/src/l3gd20.rs b/capsules/extra/src/l3gd20.rs index b03e94fdc2..2f6d3b288b 100644 --- a/capsules/extra/src/l3gd20.rs +++ b/capsules/extra/src/l3gd20.rs @@ -208,7 +208,7 @@ impl<'a, S: spi::SpiMasterDevice<'a>> L3gd20Spi<'a, S> { ) -> L3gd20Spi<'a, S> { // setup and return struct L3gd20Spi { - spi: spi, + spi, txbuffer: TakeCell::new(txbuffer), rxbuffer: TakeCell::new(rxbuffer), status: Cell::new(L3gd20Status::Idle), @@ -217,7 +217,7 @@ impl<'a, S: spi::SpiMasterDevice<'a>> L3gd20Spi<'a, S> { hpf_divider: Cell::new(0), scale: Cell::new(0), current_process: OptionalCell::empty(), - grants: grants, + grants, nine_dof_client: OptionalCell::empty(), temperature_client: OptionalCell::empty(), } diff --git a/capsules/extra/src/led_matrix.rs b/capsules/extra/src/led_matrix.rs index 32dfcd04c5..eca66ac740 100644 --- a/capsules/extra/src/led_matrix.rs +++ b/capsules/extra/src/led_matrix.rs @@ -116,8 +116,8 @@ impl<'a, L: Pin, A: Alarm<'a>> LedMatrixDriver<'a, L, A> { rows, buffer: TakeCell::new(buffer), alarm, - col_activation: col_activation, - row_activation: row_activation, + col_activation, + row_activation, current_row: Cell::new(0), timing: (1000 / (refresh_rate * rows.len())) as u8, } diff --git a/capsules/extra/src/lps22hb.rs b/capsules/extra/src/lps22hb.rs index 11d168bee9..2074aa5782 100644 --- a/capsules/extra/src/lps22hb.rs +++ b/capsules/extra/src/lps22hb.rs @@ -90,7 +90,7 @@ impl<'a, I: I2CDevice> Lps22hb<'a, I> { pub fn new(i2c_bus: &'a I, buffer: &'static mut [u8]) -> Lps22hb<'a, I> { Lps22hb { buffer: TakeCell::new(buffer), - i2c_bus: i2c_bus, + i2c_bus, pressure_client: OptionalCell::empty(), pending_pressure: Cell::new(false), state: Cell::new(State::Sleep), diff --git a/capsules/extra/src/lps25hb.rs b/capsules/extra/src/lps25hb.rs index 03f0f16540..b3ed76f610 100644 --- a/capsules/extra/src/lps25hb.rs +++ b/capsules/extra/src/lps25hb.rs @@ -121,8 +121,8 @@ impl<'a, I: i2c::I2CDevice> LPS25HB<'a, I> { ) -> Self { // setup and return struct Self { - i2c: i2c, - interrupt_pin: interrupt_pin, + i2c, + interrupt_pin, state: Cell::new(State::Idle), buffer: TakeCell::new(buffer), apps, diff --git a/capsules/extra/src/lsm303agr.rs b/capsules/extra/src/lsm303agr.rs index ffc583922d..e728c8617f 100644 --- a/capsules/extra/src/lsm303agr.rs +++ b/capsules/extra/src/lsm303agr.rs @@ -173,8 +173,8 @@ impl<'a, I: i2c::I2CDevice> Lsm303agrI2C<'a, I> { // setup and return struct Lsm303agrI2C { config_in_progress: Cell::new(false), - i2c_accelerometer: i2c_accelerometer, - i2c_magnetometer: i2c_magnetometer, + i2c_accelerometer, + i2c_magnetometer, state: Cell::new(State::Idle), accel_scale: Cell::new(Lsm303Scale::Scale2G), mag_range: Cell::new(Lsm303Range::Range1G), diff --git a/capsules/extra/src/lsm303dlhc.rs b/capsules/extra/src/lsm303dlhc.rs index 1117a020b5..6f1c4858a6 100644 --- a/capsules/extra/src/lsm303dlhc.rs +++ b/capsules/extra/src/lsm303dlhc.rs @@ -170,8 +170,8 @@ impl<'a, I: i2c::I2CDevice> Lsm303dlhcI2C<'a, I> { // setup and return struct Lsm303dlhcI2C { config_in_progress: Cell::new(false), - i2c_accelerometer: i2c_accelerometer, - i2c_magnetometer: i2c_magnetometer, + i2c_accelerometer, + i2c_magnetometer, state: Cell::new(State::Idle), accel_scale: Cell::new(Lsm303Scale::Scale2G), mag_range: Cell::new(Lsm303Range::Range1G), diff --git a/capsules/extra/src/lsm6dsoxtr.rs b/capsules/extra/src/lsm6dsoxtr.rs index 1802594dc0..1d588c38f8 100644 --- a/capsules/extra/src/lsm6dsoxtr.rs +++ b/capsules/extra/src/lsm6dsoxtr.rs @@ -194,7 +194,7 @@ impl<'a, I: i2c::I2CDevice> Lsm6dsoxtrI2C<'a, I> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> Lsm6dsoxtrI2C<'a, I> { Lsm6dsoxtrI2C { - i2c: i2c, + i2c, state: Cell::new(State::Idle), config_in_progress: Cell::new(false), gyro_data_rate: Cell::new(LSM6DSOXGyroDataRate::LSM6DSOX_GYRO_RATE_12_5_HZ), diff --git a/capsules/extra/src/ltc294x.rs b/capsules/extra/src/ltc294x.rs index 5acaaacf6d..3f4717593b 100644 --- a/capsules/extra/src/ltc294x.rs +++ b/capsules/extra/src/ltc294x.rs @@ -155,8 +155,8 @@ impl<'a, I: i2c::I2CDevice> LTC294X<'a, I> { buffer: &'static mut [u8], ) -> LTC294X<'a, I> { LTC294X { - i2c: i2c, - interrupt_pin: interrupt_pin, + i2c, + interrupt_pin, model: Cell::new(ChipModel::LTC2941), state: Cell::new(State::Idle), buffer: TakeCell::new(buffer), @@ -454,7 +454,7 @@ impl<'a, I: i2c::I2CDevice> LTC294XDriver<'a, I> { ) -> LTC294XDriver<'a, I> { LTC294XDriver { ltc294x: ltc, - grants: grants, + grants, owning_process: OptionalCell::empty(), } } diff --git a/capsules/extra/src/max17205.rs b/capsules/extra/src/max17205.rs index c2e6ce6030..014cdda460 100644 --- a/capsules/extra/src/max17205.rs +++ b/capsules/extra/src/max17205.rs @@ -124,8 +124,8 @@ pub struct MAX17205<'a, I: i2c::I2CDevice> { impl<'a, I: i2c::I2CDevice> MAX17205<'a, I> { pub fn new(i2c_lower: &'a I, i2c_upper: &'a I, buffer: &'static mut [u8]) -> MAX17205<'a, I> { MAX17205 { - i2c_lower: i2c_lower, - i2c_upper: i2c_upper, + i2c_lower, + i2c_upper, state: Cell::new(State::Idle), soc: Cell::new(0), soc_mah: Cell::new(0), diff --git a/capsules/extra/src/mcp230xx.rs b/capsules/extra/src/mcp230xx.rs index 5e8d7dcd72..30132e4bd8 100644 --- a/capsules/extra/src/mcp230xx.rs +++ b/capsules/extra/src/mcp230xx.rs @@ -156,13 +156,13 @@ impl<'a, I: hil::i2c::I2CDevice> MCP230xx<'a, I> { number_of_banks: u8, ) -> MCP230xx<'a, I> { MCP230xx { - i2c: i2c, + i2c, state: Cell::new(State::Idle), - bank_size: bank_size, - number_of_banks: number_of_banks, + bank_size, + number_of_banks, buffer: TakeCell::new(buffer), - interrupt_pin_a: interrupt_pin_a, - interrupt_pin_b: interrupt_pin_b, + interrupt_pin_a, + interrupt_pin_b, interrupts_enabled: Cell::new(0), interrupts_mode: Cell::new(0), client: OptionalCell::empty(), diff --git a/capsules/extra/src/mx25r6435f.rs b/capsules/extra/src/mx25r6435f.rs index e9a14b9d2a..bcc125cd26 100644 --- a/capsules/extra/src/mx25r6435f.rs +++ b/capsules/extra/src/mx25r6435f.rs @@ -206,11 +206,11 @@ impl< hold_pin: Option<&'a P>, ) -> MX25R6435F<'a, S, P, A> { MX25R6435F { - spi: spi, - alarm: alarm, + spi, + alarm, state: Cell::new(State::Idle), - write_protect_pin: write_protect_pin, - hold_pin: hold_pin, + write_protect_pin, + hold_pin, txbuffer: TakeCell::new(txbuffer), rxbuffer: TakeCell::new(rxbuffer), client: OptionalCell::empty(), diff --git a/capsules/extra/src/net/icmpv6/icmpv6.rs b/capsules/extra/src/net/icmpv6/icmpv6.rs index 703df9171e..05e8f1699f 100644 --- a/capsules/extra/src/net/icmpv6/icmpv6.rs +++ b/capsules/extra/src/net/icmpv6/icmpv6.rs @@ -49,7 +49,7 @@ impl ICMP6Header { ICMP6Header { code: 0, cksum: 0, - options: options, + options, len: 0, } } diff --git a/capsules/extra/src/net/icmpv6/icmpv6_send.rs b/capsules/extra/src/net/icmpv6/icmpv6_send.rs index 9874074eb1..7ed208a092 100644 --- a/capsules/extra/src/net/icmpv6/icmpv6_send.rs +++ b/capsules/extra/src/net/icmpv6/icmpv6_send.rs @@ -70,7 +70,7 @@ pub struct ICMP6SendStruct<'a, T: IP6Sender<'a>> { impl<'a, T: IP6Sender<'a>> ICMP6SendStruct<'a, T> { pub fn new(ip_send_struct: &'a T) -> ICMP6SendStruct<'a, T> { ICMP6SendStruct { - ip_send_struct: ip_send_struct, + ip_send_struct, client: OptionalCell::empty(), } } diff --git a/capsules/extra/src/net/ieee802154.rs b/capsules/extra/src/net/ieee802154.rs index 42a99c6fb5..7cd640d8d9 100644 --- a/capsules/extra/src/net/ieee802154.rs +++ b/capsules/extra/src/net/ieee802154.rs @@ -327,10 +327,10 @@ impl Security { stream_done!( off, Security { - level: level, - asn_in_nonce: asn_in_nonce, - frame_counter: frame_counter, - key_id: key_id, + level, + asn_in_nonce, + frame_counter, + key_id, } ); } @@ -411,8 +411,8 @@ impl HeaderIE<'_> { 0x7e => HeaderIE::Termination1, 0x7f => HeaderIE::Termination2, element_id => HeaderIE::Undissected { - element_id: element_id, - content: content, + element_id, + content, }, }; @@ -474,10 +474,7 @@ impl PayloadIE<'_> { let ie = match element_id { 0xf => PayloadIE::Termination, - group_id => PayloadIE::Undissected { - group_id: group_id, - content: content, - }, + group_id => PayloadIE::Undissected { group_id, content }, }; stream_done!(off + content_len, ie); @@ -770,20 +767,20 @@ impl Header<'_> { off, ( Header { - frame_type: frame_type, - frame_pending: frame_pending, - ack_requested: ack_requested, - version: version, - seq: seq, - dst_pan: dst_pan, - dst_addr: dst_addr, - src_pan: src_pan, - src_addr: src_addr, - security: security, - header_ies: header_ies, - header_ies_len: header_ies_len, - payload_ies: payload_ies, - payload_ies_len: payload_ies_len, + frame_type, + frame_pending, + ack_requested, + version, + seq, + dst_pan, + dst_addr, + src_pan, + src_addr, + security, + header_ies, + header_ies_len, + payload_ies, + payload_ies_len, }, mac_payload_off ) diff --git a/capsules/extra/src/net/ipv6/ipv6.rs b/capsules/extra/src/net/ipv6/ipv6.rs index 5a7b3b2047..cf7787a4a3 100644 --- a/capsules/extra/src/net/ipv6/ipv6.rs +++ b/capsules/extra/src/net/ipv6/ipv6.rs @@ -105,7 +105,7 @@ impl Default for IP6Header { version_class_flow: [version, 0, 0, 0], payload_len: 0, next_header: ip6_nh::NO_NEXT, - hop_limit: hop_limit, + hop_limit, src_addr: IPAddr::new(), dst_addr: IPAddr::new(), } @@ -334,10 +334,7 @@ impl<'a> IPPayload<'a> { /// `header` - A `TransportHeader` for the `IPPayload` /// `payload` - A reference to a mutable buffer for the raw payload pub fn new(header: TransportHeader, payload: &'a mut [u8]) -> IPPayload<'a> { - IPPayload { - header: header, - payload: payload, - } + IPPayload { header, payload } } /// This function sets the payload for the `IPPayload`, and sets both the @@ -439,7 +436,7 @@ impl<'a> IP6Packet<'a> { pub fn new(payload: IPPayload<'a>) -> IP6Packet<'a> { IP6Packet { header: IP6Header::default(), - payload: payload, + payload, } } diff --git a/capsules/extra/src/net/ipv6/ipv6_send.rs b/capsules/extra/src/net/ipv6/ipv6_send.rs index e7ffaf47fc..9a6c55e66e 100644 --- a/capsules/extra/src/net/ipv6/ipv6_send.rs +++ b/capsules/extra/src/net/ipv6/ipv6_send.rs @@ -184,16 +184,16 @@ impl<'a, A: time::Alarm<'a>> IP6SendStruct<'a, A> { ) -> IP6SendStruct<'a, A> { IP6SendStruct { ip6_packet: TakeCell::new(ip6_packet), - alarm: alarm, + alarm, src_addr: Cell::new(IPAddr::new()), gateway: Cell::new(dst_mac_addr), tx_buf: TakeCell::new(tx_buf), - sixlowpan: sixlowpan, - radio: radio, - dst_mac_addr: dst_mac_addr, - src_mac_addr: src_mac_addr, + sixlowpan, + radio, + dst_mac_addr, + src_mac_addr, client: OptionalCell::empty(), - ip_vis: ip_vis, + ip_vis, } } diff --git a/capsules/extra/src/net/network_capabilities.rs b/capsules/extra/src/net/network_capabilities.rs index 226bc6f6d9..fa88b06072 100644 --- a/capsules/extra/src/net/network_capabilities.rs +++ b/capsules/extra/src/net/network_capabilities.rs @@ -128,9 +128,9 @@ impl NetworkCapability { _create_net_cap: &dyn NetworkCapabilityCreationCapability, ) -> NetworkCapability { NetworkCapability { - remote_addrs: remote_addrs, - remote_ports: remote_ports, - local_ports: local_ports, + remote_addrs, + remote_ports, + local_ports, } } diff --git a/capsules/extra/src/net/sixlowpan/sixlowpan_state.rs b/capsules/extra/src/net/sixlowpan/sixlowpan_state.rs index 3c6baf8c8a..366cdb2cb5 100644 --- a/capsules/extra/src/net/sixlowpan/sixlowpan_state.rs +++ b/capsules/extra/src/net/sixlowpan/sixlowpan_state.rs @@ -355,7 +355,7 @@ impl<'a> TxState<'a> { dgram_offset: Cell::new(0), busy: Cell::new(false), - sixlowpan: sixlowpan, + sixlowpan, } } @@ -879,8 +879,8 @@ impl<'a, A: time::Alarm<'a>, C: ContextStore> Sixlowpan<'a, A, C> { /// have an accuracy of at least 60 seconds. pub fn new(ctx_store: C, clock: &'a A) -> Sixlowpan<'a, A, C> { Sixlowpan { - ctx_store: ctx_store, - clock: clock, + ctx_store, + clock, tx_dgram_tag: Cell::new(0), rx_client: Cell::new(None), diff --git a/capsules/extra/src/net/thread/driver.rs b/capsules/extra/src/net/thread/driver.rs index f24e23c1ef..16d085d266 100644 --- a/capsules/extra/src/net/thread/driver.rs +++ b/capsules/extra/src/net/thread/driver.rs @@ -161,18 +161,18 @@ impl<'a, A: time::Alarm<'a>> ThreadNetworkDriver<'a, A> { net_cap: &'static NetworkCapability, ) -> ThreadNetworkDriver<'a, A> { ThreadNetworkDriver { - sender: sender, - aes_crypto: aes_crypto, - alarm: alarm, + sender, + aes_crypto, + alarm, apps: grant, - src_mac_addr: src_mac_addr, - max_tx_pyld_len: max_tx_pyld_len, - port_table: port_table, + src_mac_addr, + max_tx_pyld_len, + port_table, send_buffer: MapCell::new(send_buffer), recv_buffer: MapCell::new(recv_buffer), state: MapCell::empty(), - driver_send_cap: driver_send_cap, - net_cap: net_cap, + driver_send_cap, + net_cap, frame_count: Cell::new(5), networkkey: MapCell::empty(), crypto_sizelock: MapCell::empty(), diff --git a/capsules/extra/src/net/thread/tlv.rs b/capsules/extra/src/net/thread/tlv.rs index 6b21419f07..50c21e4a25 100644 --- a/capsules/extra/src/net/thread/tlv.rs +++ b/capsules/extra/src/net/thread/tlv.rs @@ -356,11 +356,11 @@ impl Tlv<'_> { stream_done!( offset, Tlv::LeaderData { - partition_id: partition_id, - weighting: weighting, - data_version: data_version, - stable_data_version: stable_data_version, - leader_router_id: leader_router_id, + partition_id, + weighting, + data_version, + stable_data_version, + leader_router_id, } ) } @@ -400,15 +400,15 @@ impl Tlv<'_> { stream_done!( offset, Tlv::Connectivity { - parent_priority: parent_priority, - link_quality_3: link_quality_3, - link_quality_2: link_quality_2, - link_quality_1: link_quality_1, - leader_cost: leader_cost, - id_sequence: id_sequence, - active_routers: active_routers, - sed_buffer_size: sed_buffer_size, - sed_datagram_count: sed_datagram_count, + parent_priority, + link_quality_3, + link_quality_2, + link_quality_1, + leader_cost, + id_sequence, + active_routers, + sed_buffer_size, + sed_datagram_count, } ) } @@ -668,9 +668,9 @@ impl NetworkDataTlv<'_> { offset + length as usize, ( NetworkDataTlv::Prefix { - domain_id: domain_id, - prefix_length_bits: prefix_length_bits, - prefix: prefix, + domain_id, + prefix_length_bits, + prefix, sub_tlvs: &buf[offset..offset + length as usize], }, stable @@ -685,8 +685,8 @@ impl NetworkDataTlv<'_> { offset, ( NetworkDataTlv::CommissioningData { - com_length: com_length, - com_data: com_data, + com_length, + com_data, }, stable ) @@ -704,11 +704,11 @@ impl NetworkDataTlv<'_> { offset + length as usize, ( NetworkDataTlv::Service { - thread_enterprise_number: thread_enterprise_number, - s_id: s_id, - s_enterprise_number: s_enterprise_number, - s_service_data_length: s_service_data_length, - s_service_data: s_service_data, + thread_enterprise_number, + s_id, + s_enterprise_number, + s_service_data_length, + s_service_data, sub_tlvs: &buf[offset..offset + length as usize], }, stable @@ -839,9 +839,9 @@ impl PrefixSubTlv<'_> { offset, ( PrefixSubTlv::SixLoWpanId { - context_id_compress: context_id_compress, - context_id: context_id, - context_length: context_length, + context_id_compress, + context_id, + context_length, }, stable ) @@ -909,8 +909,8 @@ impl HasRouteTlvValue { stream_done!( offset, HasRouteTlvValue { - r_border_router_16: r_border_router_16, - r_preference: r_preference, + r_border_router_16, + r_preference, } ) } @@ -953,8 +953,8 @@ impl BorderRouterTlvValue { stream_done!( offset, BorderRouterTlvValue { - p_border_router_16: p_border_router_16, - p_bits: p_bits, + p_border_router_16, + p_bits, } ) } @@ -1016,8 +1016,8 @@ impl ServiceSubTlv { offset, ( ServiceSubTlv::Server { - s_server_16: s_server_16, - s_server_data: s_server_data, + s_server_16, + s_server_data, }, stable ) @@ -1259,8 +1259,8 @@ impl NetworkManagementTlv<'_> { stream_done!( offset, NetworkManagementTlv::Channel { - channel_page: channel_page, - channel: channel, + channel_page, + channel, } ) } @@ -1331,8 +1331,8 @@ impl NetworkManagementTlv<'_> { stream_done!( offset, NetworkManagementTlv::SecurityPolicy { - rotation_time: rotation_time, - policy_bits: policy_bits, + rotation_time, + policy_bits, } ) } @@ -1343,7 +1343,7 @@ impl NetworkManagementTlv<'_> { stream_done!( offset, NetworkManagementTlv::ActiveTimestamp { - timestamp_seconds: timestamp_seconds, + timestamp_seconds, timestamp_ticks: timestamp_ticks >> 1, u_bit: (timestamp_ticks & 1u16) > 0, } @@ -1360,7 +1360,7 @@ impl NetworkManagementTlv<'_> { stream_done!( offset, NetworkManagementTlv::PendingTimestamp { - timestamp_seconds: timestamp_seconds, + timestamp_seconds, timestamp_ticks: timestamp_ticks >> 1, u_bit: (timestamp_ticks & 1u16) > 0, } @@ -1504,9 +1504,9 @@ impl ChannelMaskEntry { stream_done!( offset, ChannelMaskEntry { - channel_page: channel_page, - mask_length: mask_length, - channel_mask: channel_mask, + channel_page, + mask_length, + channel_mask, } ) } diff --git a/capsules/extra/src/net/udp/driver.rs b/capsules/extra/src/net/udp/driver.rs index b8607c596c..7f1789e3b8 100644 --- a/capsules/extra/src/net/udp/driver.rs +++ b/capsules/extra/src/net/udp/driver.rs @@ -165,15 +165,15 @@ impl<'a> UDPDriver<'a> { net_cap: &'static NetworkCapability, ) -> UDPDriver<'a> { UDPDriver { - sender: sender, + sender, apps: grant, current_app: Cell::new(None), - interface_list: interface_list, - max_tx_pyld_len: max_tx_pyld_len, - port_table: port_table, + interface_list, + max_tx_pyld_len, + port_table, kernel_buffer: MapCell::new(kernel_buffer), - driver_send_cap: driver_send_cap, - net_cap: net_cap, + driver_send_cap, + net_cap, } } @@ -322,7 +322,7 @@ impl<'a> UDPDriver<'a> { addr.0.copy_from_slice(a); let pair = UDPEndpoint { - addr: addr, + addr, port: host_slice_to_u16(p), }; Some(pair) diff --git a/capsules/extra/src/net/udp/udp_port_table.rs b/capsules/extra/src/net/udp/udp_port_table.rs index 3516a9251d..21f9a626b7 100644 --- a/capsules/extra/src/net/udp/udp_port_table.rs +++ b/capsules/extra/src/net/udp/udp_port_table.rs @@ -96,7 +96,7 @@ impl UdpSocket { // obtain access to ports bound by other capsules fn new(idx: usize, pt: &'static UdpPortManager) -> UdpSocket { UdpSocket { - idx: idx, + idx, port_table: pt, } } @@ -126,10 +126,7 @@ pub struct UdpPortBindingTx { impl UdpPortBindingTx { fn new(idx: usize, port: u16) -> UdpPortBindingTx { - UdpPortBindingTx { - idx: idx, - port: port, - } + UdpPortBindingTx { idx, port } } pub fn get_port(&self) -> u16 { @@ -139,10 +136,7 @@ impl UdpPortBindingTx { impl UdpPortBindingRx { fn new(idx: usize, port: u16) -> UdpPortBindingRx { - UdpPortBindingRx { - idx: idx, - port: port, - } + UdpPortBindingRx { idx, port } } pub fn get_port(&self) -> u16 { @@ -160,7 +154,7 @@ impl UdpPortManager { UdpPortManager { port_array: TakeCell::new(used_kernel_ports), user_ports: OptionalCell::empty(), - udp_vis: udp_vis, + udp_vis, } } diff --git a/capsules/extra/src/net/udp/udp_send.rs b/capsules/extra/src/net/udp/udp_send.rs index 267c6642fe..b5538bf59a 100644 --- a/capsules/extra/src/net/udp/udp_send.rs +++ b/capsules/extra/src/net/udp/udp_send.rs @@ -353,14 +353,14 @@ impl<'a, T: IP6Sender<'a>> UDPSendStruct<'a, T> { udp_vis: &'static UdpVisibilityCapability, ) -> UDPSendStruct<'a, T> { UDPSendStruct { - udp_mux_sender: udp_mux_sender, + udp_mux_sender, client: OptionalCell::empty(), next: ListLink::empty(), tx_buffer: MapCell::empty(), next_dest: Cell::new(IPAddr::new()), next_th: OptionalCell::empty(), binding: MapCell::empty(), - udp_vis: udp_vis, + udp_vis, net_cap: OptionalCell::empty(), } } diff --git a/capsules/extra/src/ninedof.rs b/capsules/extra/src/ninedof.rs index c994758a45..629c78fe88 100644 --- a/capsules/extra/src/ninedof.rs +++ b/capsules/extra/src/ninedof.rs @@ -68,7 +68,7 @@ impl<'a> NineDof<'a> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> NineDof<'a> { NineDof { - drivers: drivers, + drivers, apps: grant, current_app: OptionalCell::empty(), } diff --git a/capsules/extra/src/nonvolatile_storage_driver.rs b/capsules/extra/src/nonvolatile_storage_driver.rs index 0b9259cf9c..f691b925e0 100644 --- a/capsules/extra/src/nonvolatile_storage_driver.rs +++ b/capsules/extra/src/nonvolatile_storage_driver.rs @@ -188,14 +188,14 @@ impl<'a> NonvolatileStorage<'a> { buffer: &'static mut [u8], ) -> NonvolatileStorage<'a> { NonvolatileStorage { - driver: driver, + driver, apps: grant, buffer: TakeCell::new(buffer), current_user: OptionalCell::empty(), - userspace_start_address: userspace_start_address, - userspace_length: userspace_length, - kernel_start_address: kernel_start_address, - kernel_length: kernel_length, + userspace_start_address, + userspace_length, + kernel_start_address, + kernel_length, kernel_client: OptionalCell::empty(), kernel_pending_command: Cell::new(false), kernel_command: Cell::new(NonvolatileCommand::KernelRead), @@ -272,9 +272,7 @@ impl<'a> NonvolatileStorage<'a> { if self.current_user.is_none() { // No app is currently using the underlying storage. // Mark this app as active, and then execute the command. - self.current_user.set(NonvolatileUser::App { - processid: processid, - }); + self.current_user.set(NonvolatileUser::App { processid }); // Need to copy bytes if this is a write! if command == NonvolatileCommand::UserspaceWrite { @@ -415,9 +413,7 @@ impl<'a> NonvolatileStorage<'a> { let started_command = cntr.enter(|app, _| { if app.pending_command { app.pending_command = false; - self.current_user.set(NonvolatileUser::App { - processid: processid, - }); + self.current_user.set(NonvolatileUser::App { processid }); if let Ok(()) = self.userspace_call_driver(app.command, app.offset, app.length) { diff --git a/capsules/extra/src/nonvolatile_to_pages.rs b/capsules/extra/src/nonvolatile_to_pages.rs index c7430f0328..1bc0fa8c3f 100644 --- a/capsules/extra/src/nonvolatile_to_pages.rs +++ b/capsules/extra/src/nonvolatile_to_pages.rs @@ -81,7 +81,7 @@ pub struct NonvolatileToPages<'a, F: hil::flash::Flash + 'static> { impl<'a, F: hil::flash::Flash> NonvolatileToPages<'a, F> { pub fn new(driver: &'a F, buffer: &'static mut F::Page) -> NonvolatileToPages<'a, F> { NonvolatileToPages { - driver: driver, + driver, client: OptionalCell::empty(), pagebuffer: TakeCell::new(buffer), state: Cell::new(State::Idle), diff --git a/capsules/extra/src/nrf51822_serialization.rs b/capsules/extra/src/nrf51822_serialization.rs index 01b57b3519..f520e0de77 100644 --- a/capsules/extra/src/nrf51822_serialization.rs +++ b/capsules/extra/src/nrf51822_serialization.rs @@ -107,8 +107,8 @@ impl<'a> Nrf51822Serialization<'a> { rx_buffer: &'static mut [u8], ) -> Nrf51822Serialization<'a> { Nrf51822Serialization { - uart: uart, - reset_pin: reset_pin, + uart, + reset_pin, apps: grant, active_app: OptionalCell::empty(), tx_buffer: TakeCell::new(tx_buffer), diff --git a/capsules/extra/src/pressure.rs b/capsules/extra/src/pressure.rs index e143617c8f..93d9cf5110 100644 --- a/capsules/extra/src/pressure.rs +++ b/capsules/extra/src/pressure.rs @@ -81,8 +81,8 @@ impl<'a, T: hil::sensors::PressureDriver<'a>> PressureSensor<'a, T> { apps: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> PressureSensor<'a, T> { PressureSensor { - driver: driver, - apps: apps, + driver, + apps, busy: Cell::new(false), } } diff --git a/capsules/extra/src/proximity.rs b/capsules/extra/src/proximity.rs index 7d12a7dca8..d82b09ee00 100644 --- a/capsules/extra/src/proximity.rs +++ b/capsules/extra/src/proximity.rs @@ -97,7 +97,7 @@ impl<'a> ProximitySensor<'a> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> ProximitySensor<'a> { ProximitySensor { - driver: driver, + driver, apps: grant, command_running: Cell::new(ProximityCommand::NoCommand), } diff --git a/capsules/extra/src/pwm.rs b/capsules/extra/src/pwm.rs index 8d5b4f756d..5bc2f56a36 100644 --- a/capsules/extra/src/pwm.rs +++ b/capsules/extra/src/pwm.rs @@ -33,7 +33,7 @@ impl<'a, const NUM_PINS: usize> Pwm<'a, NUM_PINS> { assert!(u16::try_from(NUM_PINS).is_ok()); const EMPTY: OptionalCell = OptionalCell::empty(); Pwm { - pwm_pins: pwm_pins, + pwm_pins, apps: grant, active_process: [EMPTY; NUM_PINS], } diff --git a/capsules/extra/src/rf233.rs b/capsules/extra/src/rf233.rs index 3b8b87938b..471cb3d702 100644 --- a/capsules/extra/src/rf233.rs +++ b/capsules/extra/src/rf233.rs @@ -1044,7 +1044,7 @@ impl<'a, S: spi::SpiMasterDevice<'a>> RF233<'a, S> { channel: radio::RadioChannel, ) -> RF233<'a, S> { RF233 { - spi: spi, + spi, reset_pin: reset, sleep_pin: sleep, irq_pin: irq, diff --git a/capsules/extra/src/screen.rs b/capsules/extra/src/screen.rs index 7ce903cddb..c71f884ab6 100644 --- a/capsules/extra/src/screen.rs +++ b/capsules/extra/src/screen.rs @@ -127,8 +127,8 @@ impl<'a> Screen<'a> { grant: Grant, AllowRoCount<{ ro_allow::COUNT }>, AllowRwCount<0>>, ) -> Screen<'a> { Screen { - screen: screen, - screen_setup: screen_setup, + screen, + screen_setup, apps: grant, current_process: OptionalCell::empty(), pixel_format: Cell::new(screen.get_pixel_format()), diff --git a/capsules/extra/src/screen_shared.rs b/capsules/extra/src/screen_shared.rs index af6bf83ad9..4ec16a3ab4 100644 --- a/capsules/extra/src/screen_shared.rs +++ b/capsules/extra/src/screen_shared.rs @@ -134,7 +134,7 @@ impl<'a, S: hil::screen::Screen<'a>> ScreenShared<'a, S> { apps_regions: &'a [AppScreenRegion], ) -> ScreenShared<'a, S> { ScreenShared { - screen: screen, + screen, apps: grant, current_process: OptionalCell::empty(), buffer: TakeCell::new(buffer), diff --git a/capsules/extra/src/sdcard.rs b/capsules/extra/src/sdcard.rs index eacf1ad821..e808aea909 100644 --- a/capsules/extra/src/sdcard.rs +++ b/capsules/extra/src/sdcard.rs @@ -278,10 +278,10 @@ impl<'a, A: hil::time::Alarm<'a>> SDCard<'a, A> { // set up and return struct SDCard { - spi: spi, + spi, state: Cell::new(SpiState::Idle), after_state: Cell::new(SpiState::Idle), - alarm: alarm, + alarm, alarm_state: Cell::new(AlarmState::Idle), alarm_count: Cell::new(0), is_initialized: Cell::new(false), @@ -813,7 +813,7 @@ impl<'a, A: hil::time::Alarm<'a>> SDCard<'a, A> { self.read_bytes(write_buffer, read_buffer, 1); } else { // check for data block to be ready - self.state.set(SpiState::WaitReadBlocks { count: count }); + self.state.set(SpiState::WaitReadBlocks { count }); self.read_bytes(write_buffer, read_buffer, 1); } } else { @@ -890,7 +890,7 @@ impl<'a, A: hil::time::Alarm<'a>> SDCard<'a, A> { if read_buffer[0] == DATA_TOKEN { // data ready to read. Read block plus CRC self.alarm_count.set(0); - self.state.set(SpiState::ReceivedBlock { count: count }); + self.state.set(SpiState::ReceivedBlock { count }); self.read_bytes(write_buffer, read_buffer, 512 + 2); } else if read_buffer[0] == 0xFF { // line is idling high, data is not ready @@ -901,7 +901,7 @@ impl<'a, A: hil::time::Alarm<'a>> SDCard<'a, A> { // try again after 1 ms self.alarm_state - .set(AlarmState::WaitForDataBlocks { count: count }); + .set(AlarmState::WaitForDataBlocks { count }); let delay = self.alarm.ticks_from_ms(1); self.alarm.set_alarm(self.alarm.now(), delay); } else { @@ -1210,7 +1210,7 @@ impl<'a, A: hil::time::Alarm<'a>> SDCard<'a, A> { self.txbuffer.take().map(|write_buffer| { self.rxbuffer.take().map(move |read_buffer| { // wait until ready and then read data block, then done - self.state.set(SpiState::WaitReadBlocks { count: count }); + self.state.set(SpiState::WaitReadBlocks { count }); self.read_bytes(write_buffer, read_buffer, 1); }); }); @@ -1313,7 +1313,7 @@ impl<'a, A: hil::time::Alarm<'a>> SDCard<'a, A> { address *= 512; } - self.state.set(SpiState::StartReadBlocks { count: count }); + self.state.set(SpiState::StartReadBlocks { count }); if count == 1 { self.send_command( SDCmd::CMD17_ReadSingle, @@ -1372,7 +1372,7 @@ impl<'a, A: hil::time::Alarm<'a>> SDCard<'a, A> { address *= 512; } - self.state.set(SpiState::StartWriteBlocks { count: count }); + self.state.set(SpiState::StartWriteBlocks { count }); if count == 1 { self.send_command( SDCmd::CMD24_WriteSingle, diff --git a/capsules/extra/src/segger_rtt.rs b/capsules/extra/src/segger_rtt.rs index 08802152a1..4696c183b8 100644 --- a/capsules/extra/src/segger_rtt.rs +++ b/capsules/extra/src/segger_rtt.rs @@ -195,7 +195,7 @@ impl<'a, A: hil::time::Alarm<'a>> SeggerRtt<'a, A> { down_buffer: &'a mut [u8], ) -> SeggerRtt<'a, A> { SeggerRtt { - alarm: alarm, + alarm, config: TakeCell::new(config), up_buffer: TakeCell::new(up_buffer), _down_buffer: TakeCell::new(down_buffer), diff --git a/capsules/extra/src/seven_segment.rs b/capsules/extra/src/seven_segment.rs index a8dd7d19a0..e6ef94a7e5 100644 --- a/capsules/extra/src/seven_segment.rs +++ b/capsules/extra/src/seven_segment.rs @@ -224,8 +224,8 @@ impl<'a, P: Pin, A: Alarm<'a>, const NUM_DIGITS: usize> SevenSegmentDriver<'a, P digits, buffer: TakeCell::new(buffer), alarm, - segment_activation: segment_activation, - digit_activation: digit_activation, + segment_activation, + digit_activation, current_digit: Cell::new(0), timing: (1000 / (refresh_rate * digits.len())) as u8, } diff --git a/capsules/extra/src/sha.rs b/capsules/extra/src/sha.rs index f311c6693d..6bcb0dde5d 100644 --- a/capsules/extra/src/sha.rs +++ b/capsules/extra/src/sha.rs @@ -101,7 +101,7 @@ impl< >, ) -> ShaDriver<'a, H, L> { ShaDriver { - sha: sha, + sha, active: Cell::new(false), apps: grant, processid: OptionalCell::empty(), diff --git a/capsules/extra/src/sht3x.rs b/capsules/extra/src/sht3x.rs index 24f833ec46..acc2c3e514 100644 --- a/capsules/extra/src/sht3x.rs +++ b/capsules/extra/src/sht3x.rs @@ -85,14 +85,14 @@ pub struct SHT3x<'a, A: Alarm<'a>, I: i2c::I2CDevice> { impl<'a, A: Alarm<'a>, I: i2c::I2CDevice> SHT3x<'a, A, I> { pub fn new(i2c: &'a I, buffer: &'static mut [u8], alarm: &'a A) -> SHT3x<'a, A, I> { SHT3x { - i2c: i2c, + i2c, humidity_client: OptionalCell::empty(), temperature_client: OptionalCell::empty(), state: Cell::new(State::Idle), buffer: TakeCell::new(buffer), read_temp: Cell::new(false), read_hum: Cell::new(false), - alarm: alarm, + alarm, } } diff --git a/capsules/extra/src/sht4x.rs b/capsules/extra/src/sht4x.rs index 71191cd6b4..3590895bb9 100644 --- a/capsules/extra/src/sht4x.rs +++ b/capsules/extra/src/sht4x.rs @@ -80,14 +80,14 @@ pub struct SHT4x<'a, A: Alarm<'a>, I: i2c::I2CDevice> { impl<'a, A: Alarm<'a>, I: i2c::I2CDevice> SHT4x<'a, A, I> { pub fn new(i2c: &'a I, buffer: &'static mut [u8], alarm: &'a A) -> SHT4x<'a, A, I> { SHT4x { - i2c: i2c, + i2c, humidity_client: OptionalCell::empty(), temperature_client: OptionalCell::empty(), state: Cell::new(State::Idle), buffer: TakeCell::new(buffer), read_temp: Cell::new(false), read_hum: Cell::new(false), - alarm: alarm, + alarm, } } diff --git a/capsules/extra/src/si7021.rs b/capsules/extra/src/si7021.rs index f801d7e0f6..b8daa1e050 100644 --- a/capsules/extra/src/si7021.rs +++ b/capsules/extra/src/si7021.rs @@ -111,8 +111,8 @@ impl<'a, A: time::Alarm<'a>, I: i2c::I2CDevice> SI7021<'a, A, I> { pub fn new(i2c: &'a I, alarm: &'a A, buffer: &'static mut [u8]) -> SI7021<'a, A, I> { // setup and return struct SI7021 { - i2c: i2c, - alarm: alarm, + i2c, + alarm, temp_callback: OptionalCell::empty(), humidity_callback: OptionalCell::empty(), state: Cell::new(State::Idle), diff --git a/capsules/extra/src/sound_pressure.rs b/capsules/extra/src/sound_pressure.rs index ba00b5cbab..f798c28e25 100644 --- a/capsules/extra/src/sound_pressure.rs +++ b/capsules/extra/src/sound_pressure.rs @@ -84,7 +84,7 @@ impl<'a> SoundPressureSensor<'a> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> SoundPressureSensor<'a> { SoundPressureSensor { - driver: driver, + driver, apps: grant, busy: Cell::new(false), } diff --git a/capsules/extra/src/st77xx.rs b/capsules/extra/src/st77xx.rs index 7df35ba28b..83171160bd 100644 --- a/capsules/extra/src/st77xx.rs +++ b/capsules/extra/src/st77xx.rs @@ -247,11 +247,11 @@ impl<'a, A: Alarm<'a>, B: Bus<'a>, P: Pin> ST77XX<'a, A, B, P> { dc.map(|dc| dc.make_output()); reset.map(|reset| reset.make_output()); ST77XX { - alarm: alarm, + alarm, - dc: dc, - reset: reset, - bus: bus, + dc, + reset, + bus, status: Cell::new(Status::Idle), width: Cell::new(screen.default_width), @@ -273,7 +273,7 @@ impl<'a, A: Alarm<'a>, B: Bus<'a>, P: Pin> ST77XX<'a, A, B, P> { current_rotation: Cell::new(ScreenRotation::Normal), - screen: screen, + screen, } } diff --git a/capsules/extra/src/temperature.rs b/capsules/extra/src/temperature.rs index d39c32b6c7..ce5c23d781 100644 --- a/capsules/extra/src/temperature.rs +++ b/capsules/extra/src/temperature.rs @@ -83,7 +83,7 @@ impl<'a, T: hil::sensors::TemperatureDriver<'a>> TemperatureSensor<'a, T> { grant: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> TemperatureSensor<'a, T> { TemperatureSensor { - driver: driver, + driver, apps: grant, busy: Cell::new(false), } diff --git a/capsules/extra/src/temperature_rp2040.rs b/capsules/extra/src/temperature_rp2040.rs index bde1f821a2..3c2c1cb7bc 100644 --- a/capsules/extra/src/temperature_rp2040.rs +++ b/capsules/extra/src/temperature_rp2040.rs @@ -32,9 +32,9 @@ impl<'a, A: adc::AdcChannel<'a>> TemperatureRp2040<'a, A> { /// v_27 - voltage at 27 degrees Celsius found in datasheet pub fn new(adc: &'a A, slope: f32, v_27: f32) -> TemperatureRp2040<'a, A> { TemperatureRp2040 { - adc: adc, - slope: slope, - v_27: v_27, + adc, + slope, + v_27, temperature_client: OptionalCell::empty(), status: Cell::new(Status::Idle), } diff --git a/capsules/extra/src/temperature_stm.rs b/capsules/extra/src/temperature_stm.rs index 81469c5332..9d4ced1255 100644 --- a/capsules/extra/src/temperature_stm.rs +++ b/capsules/extra/src/temperature_stm.rs @@ -32,9 +32,9 @@ impl<'a, A: adc::AdcChannel<'a>> TemperatureSTM<'a, A> { /// v_25 - voltage at 25 degrees Celsius found in datasheet pub fn new(adc: &'a A, slope: f32, v_25: f32) -> TemperatureSTM<'a, A> { TemperatureSTM { - adc: adc, - slope: slope, - v_25: v_25, + adc, + slope, + v_25, temperature_client: OptionalCell::empty(), status: Cell::new(Status::Idle), } diff --git a/capsules/extra/src/test/aes.rs b/capsules/extra/src/test/aes.rs index 0a3220416f..963f0182bb 100644 --- a/capsules/extra/src/test/aes.rs +++ b/capsules/extra/src/test/aes.rs @@ -70,7 +70,7 @@ impl<'a, A: AES128<'a> + AES128ECB> TestAes128Ecb<'a, A> { test_decrypt: bool, ) -> Self { TestAes128Ecb { - aes: aes, + aes, key: TakeCell::new(key), source: TakeCell::new(source), @@ -170,7 +170,7 @@ impl<'a, A: AES128<'a> + AES128Ctr> TestAes128Ctr<'a, A> { test_decrypt: bool, ) -> Self { TestAes128Ctr { - aes: aes, + aes, key: TakeCell::new(key), iv: TakeCell::new(iv), @@ -342,7 +342,7 @@ impl<'a, A: AES128<'a> + AES128CBC> TestAes128Cbc<'a, A> { test_decrypt: bool, ) -> Self { TestAes128Cbc { - aes: aes, + aes, key: TakeCell::new(key), iv: TakeCell::new(iv), diff --git a/capsules/extra/src/test/aes_ccm.rs b/capsules/extra/src/test/aes_ccm.rs index 1fc06caa80..ae463198d2 100644 --- a/capsules/extra/src/test/aes_ccm.rs +++ b/capsules/extra/src/test/aes_ccm.rs @@ -31,7 +31,7 @@ pub struct Test<'a, A: AES128CCM<'a>> { impl<'a, A: AES128CCM<'a>> Test<'a, A> { pub fn new(aes_ccm: &'a A, buf: &'static mut [u8]) -> Test<'a, A> { Test { - aes_ccm: aes_ccm, + aes_ccm, buf: TakeCell::new(buf), current_test: Cell::new(0), encrypting: Cell::new(true), diff --git a/capsules/extra/src/test/aes_gcm.rs b/capsules/extra/src/test/aes_gcm.rs index 8d0d55bd6c..48c15d62e0 100644 --- a/capsules/extra/src/test/aes_gcm.rs +++ b/capsules/extra/src/test/aes_gcm.rs @@ -31,7 +31,7 @@ pub struct Test<'a, A: AES128GCM<'a>> { impl<'a, A: AES128GCM<'a>> Test<'a, A> { pub fn new(aes_gcm: &'a A, buf: &'static mut [u8]) -> Test<'a, A> { Test { - aes_gcm: aes_gcm, + aes_gcm, buf: TakeCell::new(buf), current_test: Cell::new(0), encrypting: Cell::new(true), diff --git a/capsules/extra/src/test/crc.rs b/capsules/extra/src/test/crc.rs index b771cfeca4..424127aefe 100644 --- a/capsules/extra/src/test/crc.rs +++ b/capsules/extra/src/test/crc.rs @@ -18,7 +18,7 @@ pub struct TestCrc<'a, C: 'a> { impl<'a, C: Crc<'a>> TestCrc<'a, C> { pub fn new(crc: &'a C, data: &'static mut [u8]) -> Self { TestCrc { - crc: crc, + crc, data: TakeCell::new(data), } } diff --git a/capsules/extra/src/test/kv_system.rs b/capsules/extra/src/test/kv_system.rs index c456e34b30..a1f7160fbe 100644 --- a/capsules/extra/src/test/kv_system.rs +++ b/capsules/extra/src/test/kv_system.rs @@ -61,7 +61,7 @@ impl<'a, S: KVSystem<'static>, T: KeyType> KVSystemTest<'a, S, T> { debug!("---Starting TicKV Tests---"); Self { - kv_system: kv_system, + kv_system, phantom: PhantomData, value: MapCell::new(value), ret_buffer: TakeCell::new(static_buf), diff --git a/capsules/extra/src/test/sha256.rs b/capsules/extra/src/test/sha256.rs index bf99982d8b..144e9956de 100644 --- a/capsules/extra/src/test/sha256.rs +++ b/capsules/extra/src/test/sha256.rs @@ -42,7 +42,7 @@ impl TestSha256 { correct: bool, ) -> Self { TestSha256 { - sha: sha, + sha, data: TakeCell::new(data), hash: TakeCell::new(hash), position: Cell::new(0), diff --git a/capsules/extra/src/test/udp.rs b/capsules/extra/src/test/udp.rs index 317feb50cc..49c642fb14 100644 --- a/capsules/extra/src/test/udp.rs +++ b/capsules/extra/src/test/udp.rs @@ -56,11 +56,11 @@ impl<'a, A: Alarm<'a>> MockUdp<'a, A> { net_cap: &'static NetworkCapability, ) -> MockUdp<'a, A> { MockUdp { - id: id, - alarm: alarm, - udp_sender: udp_sender, - udp_receiver: udp_receiver, - port_table: port_table, + id, + alarm, + udp_sender, + udp_receiver, + port_table, udp_dgram: MapCell::new(udp_dgram), src_port: Cell::new(0), // invalid initial value dst_port: Cell::new(dst_port), diff --git a/capsules/extra/src/text_screen.rs b/capsules/extra/src/text_screen.rs index cba0918665..e59e381384 100644 --- a/capsules/extra/src/text_screen.rs +++ b/capsules/extra/src/text_screen.rs @@ -85,7 +85,7 @@ impl<'a> TextScreen<'a> { grant: Grant, AllowRoCount<{ ro_allow::COUNT }>, AllowRwCount<0>>, ) -> TextScreen<'a> { TextScreen { - text_screen: text_screen, + text_screen, apps: grant, current_app: OptionalCell::empty(), buffer: TakeCell::new(buffer), diff --git a/capsules/extra/src/touch.rs b/capsules/extra/src/touch.rs index 397c7599c7..146c2c9471 100644 --- a/capsules/extra/src/touch.rs +++ b/capsules/extra/src/touch.rs @@ -98,9 +98,9 @@ impl<'a> Touch<'a> { grant: Grant, AllowRoCount<0>, AllowRwCount<{ rw_allow::COUNT }>>, ) -> Touch<'a> { Touch { - touch: touch, - multi_touch: multi_touch, - screen: screen, + touch, + multi_touch, + screen, screen_rotation_offset: Cell::new(ScreenRotation::Normal), apps: grant, } diff --git a/capsules/extra/src/tsl2561.rs b/capsules/extra/src/tsl2561.rs index f25e839232..dc02644ff9 100644 --- a/capsules/extra/src/tsl2561.rs +++ b/capsules/extra/src/tsl2561.rs @@ -229,8 +229,8 @@ impl<'a, I: i2c::I2CDevice> TSL2561<'a, I> { ) -> Self { // setup and return struct Self { - i2c: i2c, - interrupt_pin: interrupt_pin, + i2c, + interrupt_pin, state: Cell::new(State::Idle), buffer: TakeCell::new(buffer), apps, diff --git a/capsules/extra/src/tutorials/encryption_oracle_chkpt1.rs b/capsules/extra/src/tutorials/encryption_oracle_chkpt1.rs index 4c4ecf779c..2aca75f25e 100644 --- a/capsules/extra/src/tutorials/encryption_oracle_chkpt1.rs +++ b/capsules/extra/src/tutorials/encryption_oracle_chkpt1.rs @@ -23,9 +23,7 @@ impl EncryptionOracleDriver { pub fn new( process_grants: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> Self { - EncryptionOracleDriver { - process_grants: process_grants, - } + EncryptionOracleDriver { process_grants } } } diff --git a/capsules/extra/src/tutorials/encryption_oracle_chkpt2.rs b/capsules/extra/src/tutorials/encryption_oracle_chkpt2.rs index 7f283f5003..14a2c308ad 100644 --- a/capsules/extra/src/tutorials/encryption_oracle_chkpt2.rs +++ b/capsules/extra/src/tutorials/encryption_oracle_chkpt2.rs @@ -31,8 +31,8 @@ impl<'a, A: AES128<'a> + AES128Ctr> EncryptionOracleDriver<'a, A> { process_grants: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> Self { EncryptionOracleDriver { - process_grants: process_grants, - aes: aes, + aes, + process_grants, } } } diff --git a/capsules/extra/src/tutorials/encryption_oracle_chkpt3.rs b/capsules/extra/src/tutorials/encryption_oracle_chkpt3.rs index 822cfc7aca..471785dcb9 100644 --- a/capsules/extra/src/tutorials/encryption_oracle_chkpt3.rs +++ b/capsules/extra/src/tutorials/encryption_oracle_chkpt3.rs @@ -33,8 +33,8 @@ impl<'a, A: AES128<'a> + AES128Ctr> EncryptionOracleDriver<'a, A> { process_grants: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> Self { EncryptionOracleDriver { - process_grants: process_grants, - aes: aes, + process_grants, + aes, current_process: OptionalCell::empty(), } } diff --git a/capsules/extra/src/tutorials/encryption_oracle_chkpt4.rs b/capsules/extra/src/tutorials/encryption_oracle_chkpt4.rs index e92d7ba857..6d45c32c37 100644 --- a/capsules/extra/src/tutorials/encryption_oracle_chkpt4.rs +++ b/capsules/extra/src/tutorials/encryption_oracle_chkpt4.rs @@ -73,8 +73,8 @@ impl<'a, A: AES128<'a> + AES128Ctr> EncryptionOracleDriver<'a, A> { >, ) -> Self { EncryptionOracleDriver { - process_grants: process_grants, - aes: aes, + process_grants, + aes, current_process: OptionalCell::empty(), source_buffer: TakeCell::new(source_buffer), dest_buffer: TakeCell::new(dest_buffer), diff --git a/capsules/extra/src/tutorials/encryption_oracle_chkpt5.rs b/capsules/extra/src/tutorials/encryption_oracle_chkpt5.rs index 6cacc5967a..d7186dd17a 100644 --- a/capsules/extra/src/tutorials/encryption_oracle_chkpt5.rs +++ b/capsules/extra/src/tutorials/encryption_oracle_chkpt5.rs @@ -73,8 +73,8 @@ impl<'a, A: AES128<'a> + AES128Ctr> EncryptionOracleDriver<'a, A> { >, ) -> Self { EncryptionOracleDriver { - process_grants: process_grants, - aes: aes, + process_grants, + aes, current_process: OptionalCell::empty(), source_buffer: TakeCell::new(source_buffer), dest_buffer: TakeCell::new(dest_buffer), diff --git a/capsules/extra/src/usb/cdc.rs b/capsules/extra/src/usb/cdc.rs index ff90b43593..df1b48ecaf 100644 --- a/capsules/extra/src/usb/cdc.rs +++ b/capsules/extra/src/usb/cdc.rs @@ -262,8 +262,8 @@ impl<'a, U: hil::usb::UsbController<'a>, A: 'a + Alarm<'a>> CdcAcm<'a, U, A> { let (device_descriptor_buffer, other_descriptor_buffer) = descriptors::create_descriptor_buffers( descriptors::DeviceDescriptor { - vendor_id: vendor_id, - product_id: product_id, + vendor_id, + product_id, manufacturer_string: 1, product_string: 2, serial_number_string: 3, @@ -348,8 +348,8 @@ impl<'a, U: hil::usb::UsbController<'a>, A: 'a + Alarm<'a>> CdcAcm<'a, U, A> { match self.state.get() { State::Enumerated => { self.state.set(State::Connecting { - line_coding: line_coding, - line_state: line_state, + line_coding, + line_state, }); } State::Connecting { diff --git a/capsules/extra/src/usb/ctap.rs b/capsules/extra/src/usb/ctap.rs index b5c39a24aa..066b24bd7f 100644 --- a/capsules/extra/src/usb/ctap.rs +++ b/capsules/extra/src/usb/ctap.rs @@ -144,8 +144,8 @@ impl<'a, U: hil::usb::UsbController<'a>> CtapHid<'a, U> { let (device_descriptor_buffer, other_descriptor_buffer) = descriptors::create_descriptor_buffers( descriptors::DeviceDescriptor { - vendor_id: vendor_id, - product_id: product_id, + vendor_id, + product_id, manufacturer_string: 1, product_string: 2, serial_number_string: 3, diff --git a/capsules/extra/src/usb/keyboard_hid.rs b/capsules/extra/src/usb/keyboard_hid.rs index 5f38e3ce03..52a411ce58 100644 --- a/capsules/extra/src/usb/keyboard_hid.rs +++ b/capsules/extra/src/usb/keyboard_hid.rs @@ -134,8 +134,8 @@ impl<'a, U: hil::usb::UsbController<'a>> KeyboardHid<'a, U> { let (device_descriptor_buffer, other_descriptor_buffer) = descriptors::create_descriptor_buffers( descriptors::DeviceDescriptor { - vendor_id: vendor_id, - product_id: product_id, + vendor_id, + product_id, manufacturer_string: 1, product_string: 2, serial_number_string: 3, diff --git a/capsules/extra/src/usb/usb_user.rs b/capsules/extra/src/usb/usb_user.rs index 35ebc781f7..ecd322282e 100644 --- a/capsules/extra/src/usb/usb_user.rs +++ b/capsules/extra/src/usb/usb_user.rs @@ -59,8 +59,8 @@ where apps: Grant, AllowRoCount<0>, AllowRwCount<0>>, ) -> Self { UsbSyscallDriver { - usbc_client: usbc_client, - apps: apps, + usbc_client, + apps, serving_app: OptionalCell::empty(), } } diff --git a/capsules/extra/src/usb/usbc_client_ctrl.rs b/capsules/extra/src/usb/usbc_client_ctrl.rs index 56d7aaff92..1d5cf13cb7 100644 --- a/capsules/extra/src/usb/usbc_client_ctrl.rs +++ b/capsules/extra/src/usb/usbc_client_ctrl.rs @@ -111,7 +111,7 @@ impl<'a, 'b, U: hil::usb::UsbController<'a>> ClientCtrl<'a, 'b, U> { strings: &'b [&'b str], ) -> Self { ClientCtrl { - controller: controller, + controller, state: Default::default(), // For the moment, the Default trait is not implemented for arrays // of length > 32, and the Cell type is not Copy, so we have to diff --git a/capsules/extra/src/usb_hid_driver.rs b/capsules/extra/src/usb_hid_driver.rs index be3d4186be..6767199876 100644 --- a/capsules/extra/src/usb_hid_driver.rs +++ b/capsules/extra/src/usb_hid_driver.rs @@ -54,7 +54,7 @@ impl<'a, U: usb_hid::UsbHid<'a, [u8; 64]>> UsbHidDriver<'a, U> { grant: Grant, AllowRoCount<0>, AllowRwCount<{ rw_allow::COUNT }>>, ) -> UsbHidDriver<'a, U> { UsbHidDriver { - usb: usb, + usb, app: grant, processid: OptionalCell::empty(), phantom: PhantomData, diff --git a/chips/imxrt10xx/src/lpuart.rs b/chips/imxrt10xx/src/lpuart.rs index 57a8daa722..1c6a1e37b4 100644 --- a/chips/imxrt10xx/src/lpuart.rs +++ b/chips/imxrt10xx/src/lpuart.rs @@ -369,7 +369,7 @@ impl<'a> Lpuart<'a> { ) -> Lpuart<'a> { Lpuart { registers: base_addr, - clock: clock, + clock, tx_client: OptionalCell::empty(), rx_client: OptionalCell::empty(), diff --git a/chips/lowrisc/src/aon_timer.rs b/chips/lowrisc/src/aon_timer.rs index 27630e64e1..4fa5fae545 100644 --- a/chips/lowrisc/src/aon_timer.rs +++ b/chips/lowrisc/src/aon_timer.rs @@ -83,7 +83,7 @@ impl AonTimer { pub const fn new(base: StaticRef, aon_clk_freq: u32) -> AonTimer { AonTimer { registers: base, - aon_clk_freq: aon_clk_freq, + aon_clk_freq, } } diff --git a/chips/lowrisc/src/gpio.rs b/chips/lowrisc/src/gpio.rs index 5bc58ddcce..e3bb53de83 100644 --- a/chips/lowrisc/src/gpio.rs +++ b/chips/lowrisc/src/gpio.rs @@ -92,8 +92,8 @@ impl<'a, PAD> GpioPin<'a, PAD> { ) -> GpioPin<'a, PAD> { GpioPin { gpio_registers: gpio_base, - padctl: padctl, - pin: pin, + padctl, + pin, client: OptionalCell::empty(), } } diff --git a/chips/lowrisc/src/spi_host.rs b/chips/lowrisc/src/spi_host.rs index 3cec0709cb..7e013eef36 100644 --- a/chips/lowrisc/src/spi_host.rs +++ b/chips/lowrisc/src/spi_host.rs @@ -165,7 +165,7 @@ impl<'a> SpiHost<'a> { client: OptionalCell::empty(), busy: Cell::new(false), chip_select: Cell::new(0), - cpu_clk: cpu_clk, + cpu_clk, tsclk: Cell::new(0), tx_buf: TakeCell::empty(), rx_buf: TakeCell::empty(), diff --git a/chips/lowrisc/src/uart.rs b/chips/lowrisc/src/uart.rs index da99809b45..4639cc1a57 100644 --- a/chips/lowrisc/src/uart.rs +++ b/chips/lowrisc/src/uart.rs @@ -58,7 +58,7 @@ impl<'a> Uart<'a> { pub fn new(base: StaticRef, clock_frequency: u32) -> Uart<'a> { Uart { registers: base, - clock_frequency: clock_frequency, + clock_frequency, tx_client: OptionalCell::empty(), rx_client: OptionalCell::empty(), rx_deferred_call: DeferredCall::new(), diff --git a/chips/lowrisc/src/usbdev.rs b/chips/lowrisc/src/usbdev.rs index 0566e5498a..14b51325ed 100644 --- a/chips/lowrisc/src/usbdev.rs +++ b/chips/lowrisc/src/usbdev.rs @@ -1001,7 +1001,7 @@ impl<'a> hil::usb::UsbController<'a> for Usb<'a> { ); self.set_state(State::Idle(Mode::Device { - speed: speed, + speed, config: DeviceConfig::default(), })) } diff --git a/chips/lowrisc/src/virtual_otbn.rs b/chips/lowrisc/src/virtual_otbn.rs index 566dc2a37c..984e4d20f4 100644 --- a/chips/lowrisc/src/virtual_otbn.rs +++ b/chips/lowrisc/src/virtual_otbn.rs @@ -33,7 +33,7 @@ impl<'a> VirtualMuxAccel<'a> { mux: mux_accel, next: ListLink::empty(), client: OptionalCell::empty(), - id: id, + id, } } diff --git a/chips/msp432/src/dma.rs b/chips/msp432/src/dma.rs index ebf5ad7763..e1f50a8e3b 100644 --- a/chips/msp432/src/dma.rs +++ b/chips/msp432/src/dma.rs @@ -661,7 +661,7 @@ impl<'a> DmaChannel<'a> { pub fn new(chan_nr: usize) -> DmaChannel<'a> { DmaChannel { registers: DMA_BASE, - chan_nr: chan_nr, + chan_nr, in_use: Cell::new(false), config: Cell::new(DmaConfig::const_default()), transfer_type: Cell::new(DmaTransferType::None), diff --git a/chips/msp432/src/i2c.rs b/chips/msp432/src/i2c.rs index 6961f49d87..92a36cce5e 100644 --- a/chips/msp432/src/i2c.rs +++ b/chips/msp432/src/i2c.rs @@ -39,7 +39,7 @@ pub struct I2c<'a> { impl<'a> I2c<'a> { pub fn new(registers: StaticRef) -> Self { Self { - registers: registers, + registers, mode: Cell::new(OperatingMode::Unconfigured), read_len: Cell::new(0), write_len: Cell::new(0), diff --git a/chips/msp432/src/uart.rs b/chips/msp432/src/uart.rs index 9184bcbe37..713d3ec80a 100644 --- a/chips/msp432/src/uart.rs +++ b/chips/msp432/src/uart.rs @@ -92,14 +92,14 @@ impl<'a> Uart<'a> { tx_client: OptionalCell::empty(), tx_dma: OptionalCell::empty(), - tx_dma_chan: tx_dma_chan, - tx_dma_src: tx_dma_src, + tx_dma_chan, + tx_dma_src, tx_busy: Cell::new(false), rx_client: OptionalCell::empty(), rx_dma: OptionalCell::empty(), - rx_dma_chan: rx_dma_chan, - rx_dma_src: rx_dma_src, + rx_dma_chan, + rx_dma_src, rx_busy: Cell::new(false), } } diff --git a/chips/rp2040/src/chip.rs b/chips/rp2040/src/chip.rs index 19c2968df9..45aa132447 100644 --- a/chips/rp2040/src/chip.rs +++ b/chips/rp2040/src/chip.rs @@ -46,7 +46,7 @@ impl<'a, I: InterruptService> Rp2040<'a, I> { mpu: cortexm0p::mpu::MPU::new(), userspace_kernel_boundary: cortexm0p::syscall::SysCall::new(), interrupt_service, - sio: sio, + sio, processor0_interrupt_mask: interrupt_mask!(interrupts::SIO_IRQ_PROC1), processor1_interrupt_mask: interrupt_mask!(interrupts::SIO_IRQ_PROC0), } diff --git a/chips/sam4l/src/adc.rs b/chips/sam4l/src/adc.rs index bca86e51e7..74c6092a4f 100644 --- a/chips/sam4l/src/adc.rs +++ b/chips/sam4l/src/adc.rs @@ -345,7 +345,7 @@ impl<'a> Adc<'a> { // DMA status and stuff rx_dma: OptionalCell::empty(), - rx_dma_peripheral: rx_dma_peripheral, + rx_dma_peripheral, rx_length: Cell::new(0), next_dma_buffer: TakeCell::empty(), next_dma_length: Cell::new(0), diff --git a/chips/sam4l/src/flashcalw.rs b/chips/sam4l/src/flashcalw.rs index d8f07175e4..874a0c447a 100644 --- a/chips/sam4l/src/flashcalw.rs +++ b/chips/sam4l/src/flashcalw.rs @@ -516,8 +516,7 @@ impl FLASHCALW { }); } FlashState::WriteUnlocking { page } => { - self.current_state - .set(FlashState::WriteErasing { page: page }); + self.current_state.set(FlashState::WriteErasing { page }); self.flashcalw_erase_page(page); } FlashState::WriteErasing { page } => { diff --git a/chips/sam4l/src/usart.rs b/chips/sam4l/src/usart.rs index eb57210713..d5d86c99db 100644 --- a/chips/sam4l/src/usart.rs +++ b/chips/sam4l/src/usart.rs @@ -431,10 +431,10 @@ impl<'a> USART<'a> { // these get defined later by `chip.rs` rx_dma: Cell::new(None), - rx_dma_peripheral: rx_dma_peripheral, + rx_dma_peripheral, rx_len: Cell::new(0), tx_dma: Cell::new(None), - tx_dma_peripheral: tx_dma_peripheral, + tx_dma_peripheral, tx_len: Cell::new(0), // this gets defined later by `main.rs` diff --git a/chips/sam4l/src/usbc/mod.rs b/chips/sam4l/src/usbc/mod.rs index f2dcc7d883..e7f50bc3ad 100644 --- a/chips/sam4l/src/usbc/mod.rs +++ b/chips/sam4l/src/usbc/mod.rs @@ -1479,7 +1479,7 @@ impl<'a> hil::usb::UsbController<'a> for Usbc<'a> { match self.get_state() { State::Reset => self._enable(Mode::Device { - speed: speed, + speed, config: DeviceConfig::default(), state: DeviceState::default(), }), diff --git a/chips/sifive/src/gpio.rs b/chips/sifive/src/gpio.rs index acd2140f61..e535dbf932 100644 --- a/chips/sifive/src/gpio.rs +++ b/chips/sifive/src/gpio.rs @@ -102,9 +102,9 @@ impl<'a> GpioPin<'a> { ) -> GpioPin<'a> { GpioPin { registers: base, - pin: pin, - set: set, - clear: clear, + pin, + set, + clear, client: OptionalCell::empty(), } } diff --git a/chips/sifive/src/uart.rs b/chips/sifive/src/uart.rs index 90b0196716..f7249da494 100644 --- a/chips/sifive/src/uart.rs +++ b/chips/sifive/src/uart.rs @@ -110,7 +110,7 @@ impl<'a> Uart<'a> { pub fn new(base: StaticRef, clock_frequency: u32) -> Uart<'a> { Uart { registers: base, - clock_frequency: clock_frequency, + clock_frequency, stop_bits: Cell::new(hil::uart::StopBits::One), tx_client: OptionalCell::empty(), diff --git a/chips/stm32f303xc/src/usart.rs b/chips/stm32f303xc/src/usart.rs index 5eb5df58bc..8b4fe751bb 100644 --- a/chips/stm32f303xc/src/usart.rs +++ b/chips/stm32f303xc/src/usart.rs @@ -318,7 +318,7 @@ impl<'a> Usart<'a> { fn new(base_addr: StaticRef, clock: UsartClock<'a>) -> Self { Self { registers: base_addr, - clock: clock, + clock, tx_client: OptionalCell::empty(), rx_client: OptionalCell::empty(), diff --git a/chips/stm32f4xx/src/can.rs b/chips/stm32f4xx/src/can.rs index 0c4d026f16..fe7c108ab0 100644 --- a/chips/stm32f4xx/src/can.rs +++ b/chips/stm32f4xx/src/can.rs @@ -474,7 +474,7 @@ pub struct Can<'a> { impl<'a> Can<'a> { pub fn new(clocks: &'a dyn Stm32f4Clocks, registers: StaticRef) -> Can<'a> { Can { - registers: registers, + registers, clock: CanClock(phclk::PeripheralClock::new( phclk::PeripheralClockType::APB1(phclk::PCLK1::CAN1), clocks, diff --git a/chips/stm32f4xx/src/dma.rs b/chips/stm32f4xx/src/dma.rs index 114c06da64..8ad914d65e 100644 --- a/chips/stm32f4xx/src/dma.rs +++ b/chips/stm32f4xx/src/dma.rs @@ -790,7 +790,7 @@ pub struct Stream<'a, DMA: StreamServer<'a>> { impl<'a, DMA: StreamServer<'a>> Stream<'a, DMA> { fn new(streamid: StreamId, dma: &'a DMA) -> Self { Self { - streamid: streamid, + streamid, buffer: TakeCell::empty(), client: OptionalCell::empty(), peripheral: OptionalCell::empty(), diff --git a/chips/stm32f4xx/src/spi.rs b/chips/stm32f4xx/src/spi.rs index cf7978b902..fe3e6269a1 100644 --- a/chips/stm32f4xx/src/spi.rs +++ b/chips/stm32f4xx/src/spi.rs @@ -187,9 +187,9 @@ impl<'a> Spi<'a> { master_client: OptionalCell::empty(), tx_dma: OptionalCell::empty(), - tx_dma_pid: tx_dma_pid, + tx_dma_pid, rx_dma: OptionalCell::empty(), - rx_dma_pid: rx_dma_pid, + rx_dma_pid, dma_len: Cell::new(0), transfers_in_progress: Cell::new(0), diff --git a/chips/stm32f4xx/src/trng.rs b/chips/stm32f4xx/src/trng.rs index 47b913acaf..c16a2efdd8 100644 --- a/chips/stm32f4xx/src/trng.rs +++ b/chips/stm32f4xx/src/trng.rs @@ -63,7 +63,7 @@ impl<'a> Trng<'a> { clocks: &'a dyn Stm32f4Clocks, ) -> Trng<'a> { Trng { - registers: registers, + registers, clock: RngClock(phclk::PeripheralClock::new( phclk::PeripheralClockType::AHB2(phclk::HCLK2::RNG), clocks, diff --git a/chips/stm32f4xx/src/usart.rs b/chips/stm32f4xx/src/usart.rs index 21091ed7f1..9c2f20ebbc 100644 --- a/chips/stm32f4xx/src/usart.rs +++ b/chips/stm32f4xx/src/usart.rs @@ -260,15 +260,15 @@ impl<'a, DMA: dma::StreamServer<'a>> Usart<'a, DMA> { ) -> Usart<'a, DMA> { Usart { registers: base_addr, - clock: clock, + clock, tx_client: OptionalCell::empty(), rx_client: OptionalCell::empty(), tx_dma: OptionalCell::empty(), - tx_dma_pid: tx_dma_pid, + tx_dma_pid, rx_dma: OptionalCell::empty(), - rx_dma_pid: rx_dma_pid, + rx_dma_pid, tx_len: Cell::new(0), rx_len: Cell::new(0), diff --git a/libraries/tock-register-interface/src/fields.rs b/libraries/tock-register-interface/src/fields.rs index 401183d6d0..87575c5290 100644 --- a/libraries/tock-register-interface/src/fields.rs +++ b/libraries/tock-register-interface/src/fields.rs @@ -92,8 +92,8 @@ pub struct Field { impl Field { pub const fn new(mask: T, shift: usize) -> Field { Field { - mask: mask, - shift: shift, + mask, + shift, associated_register: PhantomData, } } diff --git a/libraries/tock-register-interface/src/local_register.rs b/libraries/tock-register-interface/src/local_register.rs index 23b1150342..e7f6bfd5f5 100644 --- a/libraries/tock-register-interface/src/local_register.rs +++ b/libraries/tock-register-interface/src/local_register.rs @@ -40,7 +40,7 @@ pub struct LocalRegisterCopy { impl LocalRegisterCopy { pub const fn new(value: T) -> Self { LocalRegisterCopy { - value: value, + value, associated_register: PhantomData, } } diff --git a/libraries/tock-tbf/src/parse.rs b/libraries/tock-tbf/src/parse.rs index fb757431ad..a20a53f31e 100644 --- a/libraries/tock-tbf/src/parse.rs +++ b/libraries/tock-tbf/src/parse.rs @@ -295,8 +295,8 @@ pub fn parse_tbf_header( fixed_addresses: fixed_address_pointer, permissions: permissions_pointer, storage_permissions: storage_permissions_pointer, - kernel_version: kernel_version, - short_id: short_id, + kernel_version, + short_id, }; Ok(types::TbfHeader::TbfHeaderV2(tbf_header)) diff --git a/libraries/tock-tbf/src/types.rs b/libraries/tock-tbf/src/types.rs index bd9cdb2c2f..c12ac77937 100644 --- a/libraries/tock-tbf/src/types.rs +++ b/libraries/tock-tbf/src/types.rs @@ -622,7 +622,7 @@ impl core::convert::TryFrom<&'static [u8]> for TbfFooterV2Credentials { .ok_or(TbfParseError::NotEnoughFlash)?; Ok(TbfFooterV2Credentials { format: ftype, - data: data, + data, }) } }