Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Token-Thinker committed Sep 2, 2024
1 parent 9d6cf92 commit c331d06
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions hardware/mcu/esp32/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
16 changes: 8 additions & 8 deletions hardware/src/motor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down
9 changes: 4 additions & 5 deletions hardware/src/servo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 8 additions & 6 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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)],
)?;
}
_ => {
Expand All @@ -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");
Expand Down

0 comments on commit c331d06

Please sign in to comment.