From c331d06a4bc111e27199a393f4964ab0463164fb Mon Sep 17 00:00:00 2001 From: Michael Guerrier <68760212+Token-Thinker@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:40:39 -0400 Subject: [PATCH] fmt --- hardware/mcu/esp32/src/lib.rs | 4 ++-- hardware/src/motor.rs | 16 ++++++++-------- hardware/src/servo.rs | 9 ++++----- xtask/src/main.rs | 14 ++++++++------ 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/hardware/mcu/esp32/src/lib.rs b/hardware/mcu/esp32/src/lib.rs index 8e3596d..0f8b808 100644 --- a/hardware/mcu/esp32/src/lib.rs +++ b/hardware/mcu/esp32/src/lib.rs @@ -175,8 +175,8 @@ pub async fn connection() loop { if esp_wifi::wifi::get_wifi_state() == WifiState::StaConnected { - controller.wait_for_event(WifiEvent::StaDisconnected).await; - Timer::after(Duration::from_millis(5000)).await; + controller.wait_for_event(WifiEvent::StaDisconnected).await; + Timer::after(Duration::from_millis(5000)).await; } if !matches!(controller.is_started(), Ok(true)) { diff --git a/hardware/src/motor.rs b/hardware/src/motor.rs index 1aa0db7..f887a42 100644 --- a/hardware/src/motor.rs +++ b/hardware/src/motor.rs @@ -48,8 +48,8 @@ pub trait Motor /// # Returns /// /// * `Result<(), Self::Error>` - Returns `Ok(())` if the motor is - /// successfully turned on, - /// or an error of type `Self::Error` if the operation fails. + /// successfully turned on, or an error of type `Self::Error` if the + /// operation fails. fn on(&mut self) -> Result<(), Self::Error>; /// Turn the motor off @@ -61,8 +61,8 @@ pub trait Motor /// # Returns /// /// * `Result<(), Self::Error>` - Returns `Ok(())` if the motor is - /// successfully turned off, - /// or an error of type `Self::Error` if the operation fails. + /// successfully turned off, or an error of type `Self::Error` if the + /// operation fails. fn off(&mut self) -> Result<(), Self::Error>; /// Execute a customizable launch sequence @@ -74,8 +74,8 @@ pub trait Motor /// # Returns /// /// * `Result<(), Self::Error>` - Returns `Ok(())` if the launch sequence is - /// successfully executed, - /// or an error of type `Self::Error` if the operation fails. + /// successfully executed, or an error of type `Self::Error` if the + /// operation fails. async fn launch(&mut self) -> Result<(), Self::Error>; /// Process Commands @@ -91,8 +91,8 @@ pub trait Motor /// # Returns /// /// * `Result<(), Self::Error>` - Returns `Ok(())` if the command is - /// successfully processed, - /// or an error of type `Self::Error` if the operation fails. + /// successfully processed, or an error of type `Self::Error` if the + /// operation fails. async fn process( &mut self, command: MotorCommand, diff --git a/hardware/src/servo.rs b/hardware/src/servo.rs index dc8579c..0c0f472 100644 --- a/hardware/src/servo.rs +++ b/hardware/src/servo.rs @@ -98,9 +98,8 @@ pub trait Servo /// # Returns /// /// * `Result<(), Self::Error>` - Returns `Ok(())` if the servo successfully - /// moves to the - /// specified coordinates, or an error of type `Self::Error` if the - /// operation fails. + /// moves to the specified coordinates, or an error of type `Self::Error` + /// if the operation fails. async fn move_to( &mut self, x: u16, @@ -136,8 +135,8 @@ pub trait Servo /// # Returns /// /// * `Result<(), Self::Error>` - Returns `Ok(())` if the command is - /// successfully processed, - /// or an error of type `Self::Error` if the operation fails. + /// successfully processed, or an error of type `Self::Error` if the + /// operation fails. async fn process( &mut self, command: ServoCommand, diff --git a/xtask/src/main.rs b/xtask/src/main.rs index aaff6c4..87f884b 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -172,7 +172,8 @@ fn fmt_packages( fn lint_packages( workspace: &Path, args: LintPackagesArgs, -) -> Result<()>{ +) -> Result<()> +{ let (target, _toolchain) = match args.platform { Platform::Esp32 => ("xtensa-esp32-none-elf", "esp"), Platform::Rp2040 => ("thumbv6m-none-eabi", "default"), @@ -203,10 +204,7 @@ fn lint_packages( Some("app") => { lint_package( &path, - &[ - "-Zbuild-std=core,alloc", - &format!("--target={}", target), - ], + &["-Zbuild-std=core,alloc", &format!("--target={}", target)], )?; } _ => { @@ -218,7 +216,11 @@ fn lint_packages( Ok(()) } -fn lint_package(path: &Path, args: &[&str]) -> Result<()>{ +fn lint_package( + path: &Path, + args: &[&str], +) -> Result<()> +{ log::info!("Linting package: {}", path.display()); let mut builder = CargoArgsBuilder::default().subcommand("clippy");