From 17914a09e52b1a84c9f5f71c6e9f40d80d82227f Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 16 May 2025 22:46:02 +1000 Subject: [PATCH] Use io::Error::other in gh_token.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/bin/src/gh_token.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/bin/src/gh_token.rs b/crates/bin/src/gh_token.rs index 9cc7adeb..baed6230 100644 --- a/crates/bin/src/gh_token.rs +++ b/crates/bin/src/gh_token.rs @@ -28,10 +28,7 @@ pub(super) async fn get() -> io::Result>> { .map(|token| Zeroizing::new(token.into())) }) .ok_or_else(|| { - io::Error::new( - io::ErrorKind::Other, - "Password not found in `git credential fill` output", - ) + io::Error::other("Password not found in `git credential fill` output") }) } @@ -86,8 +83,7 @@ impl CommandExt for Command { } else { zeroize_and_drop(stdout); - Err(io::Error::new( - io::ErrorKind::Other, + Err(io::Error::other( format!("`{:?}` process exited with `{status}`", self.as_std()), )) }