Fix main printing unnecessary ExitCode Debug impl

This commit is contained in:
lumi 2025-06-28 04:18:00 +10:00
parent f6b91cde10
commit c70b043281
Signed by: luaneko
GPG Key ID: 406809B8763FF07A

View File

@ -137,12 +137,13 @@ impl Args {
} }
} }
fn main() -> Result<(), ExitCode> { fn main() -> ExitCode {
panic::set_hook(Box::new(panic_cb)); panic::set_hook(Box::new(panic_cb));
let args = Args::parse(); let args = Args::parse();
if args.version { if args.version {
return Ok(print_version()); print_version();
return ExitCode::Ok;
} }
init_logger(&args); init_logger(&args);
@ -271,13 +272,13 @@ fn parse_jitlib_cmd(s: &str) -> Option<(&str, &str)> {
} }
} }
async fn main_async(args: Args, cx: &mut lb::runtime::Context) -> Result<(), ExitCode> { async fn main_async(args: Args, cx: &mut lb::runtime::Context) -> ExitCode {
for ref path in args.path { for ref path in args.path {
let chunk = match std::fs::read(path) { let chunk = match std::fs::read(path) {
Ok(chunk) => chunk, Ok(chunk) => chunk,
Err(err) => { Err(err) => {
eprintln!("{}", format_args!("{path}: {err}").red().bold()); eprintln!("{}", format_args!("{path}: {err}").red().bold());
return Err(ExitCode::NoInput); return ExitCode::NoInput;
} }
}; };
@ -288,5 +289,5 @@ async fn main_async(args: Args, cx: &mut lb::runtime::Context) -> Result<(), Exi
} }
} }
Ok(()) ExitCode::Ok
} }