Skip to content

Commit

Permalink
Switch back to ExitCode
Browse files Browse the repository at this point in the history
  • Loading branch information
timrogers committed Oct 1, 2024
1 parent 26c5c2c commit 8e4d1df
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use litra::{Device, DeviceError, DeviceHandle, Litra};
use serde::Serialize;
use std::fmt;
use std::num::TryFromIntError;
use std::process;
use std::process::ExitCode;
#[cfg(target_os = "macos")]
use std::process::Stdio;
#[cfg(target_os = "macos")]
Expand Down Expand Up @@ -577,7 +577,7 @@ async fn handle_autotoggle_command(serial_number: Option<&str>, _verbose: bool)
}

#[tokio::main]
async fn main() {
async fn main() -> ExitCode {
let args = Cli::parse();

let result = match &args.command {
Expand Down Expand Up @@ -621,8 +621,11 @@ async fn main() {

if let Err(error) = result {
eprintln!("{}", error);
process::exit(1);
ExitCode::FAILURE

Check failure on line 624 in src/main.rs

View workflow job for this annotation

GitHub Actions / Build and test (x86_64-unknown-linux-gnu, linux-amd64, ubuntu-latest)

expected `;`, found `#`

Check failure on line 624 in src/main.rs

View workflow job for this annotation

GitHub Actions / Build and test (x86_64-apple-darwin, darwin-amd64, macos-latest)

expected `;`, found `#`

Check failure on line 624 in src/main.rs

View workflow job for this annotation

GitHub Actions / Build and test (x86_64-pc-windows-msvc, windows-amd64.exe, windows-latest)

expected `;`, found `#`
// TODO: Remove this once we're on a newer tokio version that doesn't trip this up
// https://github.com/tokio-rs/tokio/pull/6874
#[allow(clippy::needless_return)]

Check failure on line 627 in src/main.rs

View workflow job for this annotation

GitHub Actions / Build and test (x86_64-unknown-linux-gnu, linux-amd64, ubuntu-latest)

expected statement after outer attribute

Check failure on line 627 in src/main.rs

View workflow job for this annotation

GitHub Actions / Build and test (x86_64-apple-darwin, darwin-amd64, macos-latest)

expected statement after outer attribute

Check failure on line 627 in src/main.rs

View workflow job for this annotation

GitHub Actions / Build and test (x86_64-pc-windows-msvc, windows-amd64.exe, windows-latest)

expected statement after outer attribute
} else {
process::exit(0);
ExitCode::SUCCESS
}
}

0 comments on commit 8e4d1df

Please sign in to comment.