From 876101c9c6964a7aaad242bbf53327f3452f176f Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Sat, 12 Sep 2026 09:39:08 +0900 Subject: [PATCH] Replace `process::exit` with `process::ExitCode` --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9a51b686d..746d0afef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,6 +27,7 @@ use std::collections::HashMap; use std::fs; use std::io::{Read, stdout}; use std::path::PathBuf; +use std::process::ExitCode; use std::time::Instant; use unicode_width::UnicodeWidthStr; @@ -119,7 +120,7 @@ fn check_old_config(s: &str, config: Result) -> Result< // Main // --------------------------------------------------------------------------------------------------------------------- -fn main() { +fn main() -> ExitCode { let err = Term::stderr(); if let Err(x) = run() { @@ -134,7 +135,9 @@ fn main() { let _ = err.write_line(&format!(" {} {}", console::style("caused by:").red(), x)); } - std::process::exit(1); + ExitCode::from(1) + } else { + ExitCode::SUCCESS } }