diff --git a/Cargo.lock b/Cargo.lock index 5e47f2f..cd18be5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -698,21 +698,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "quit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c090c608233d81bd6b90e718cf34506c60a10e633dff2292c3d1029e798d669b" -dependencies = [ - "quit_macros", -] - -[[package]] -name = "quit_macros" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d4b27a0dd5d08ad7af2d17952fb360ec9c30eeade0b32df7a3c9b099ff37564" - [[package]] name = "quote" version = "1.0.36" @@ -890,7 +875,6 @@ dependencies = [ "maud", "native-tls", "nom", - "quit", "r2d2", "r2d2_sqlite", "rusqlite", diff --git a/Cargo.toml b/Cargo.toml index 3d104be..322d381 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,6 @@ log = "0.4.8" maud = "0.26.0" native-tls = "0.2.10" nom = { version = "7.0.0", features = ["std"], default-features = false } -quit = "2.0.0" r2d2 = "0.8.9" r2d2_sqlite = "0.24.0" rusqlite = { version = "0.31.0", features = ["bundled"] } diff --git a/src/main.rs b/src/main.rs index e929815..caa5f64 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +use std::process::ExitCode; use anyhow::{bail, Result}; use gumdrop::{Options, ParsingStyle}; use sekshibot::{ConnectionOptions, SekshiBot, UnauthorizedError}; @@ -14,7 +15,7 @@ pub struct Cli { pub help: bool, } -fn main() -> Result<()> { +fn main() -> Result { femme::with_level(log::LevelFilter::Info); let args = Cli::parse_args_or_exit(ParsingStyle::AllOptions); log::info!("args: {:?}", args); @@ -40,11 +41,11 @@ fn main() -> Result<()> { })(); match result { - Ok(_) => Ok(()), + Ok(_) => Ok(ExitCode::SUCCESS), Err(err) => { if err.is::() { eprintln!("Error: {err}"); - quit::with_code(75); + Ok(ExitCode::from(75)) } else { Err(err) }