Fmt gh_token.rs

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Jiahao XU 2025-05-16 23:02:11 +10:00 committed by GitHub
parent 17914a09e5
commit ae0932aa11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,9 +27,7 @@ pub(super) async fn get() -> io::Result<Zeroizing<Box<str>>> {
.strip_prefix("password=") .strip_prefix("password=")
.map(|token| Zeroizing::new(token.into())) .map(|token| Zeroizing::new(token.into()))
}) })
.ok_or_else(|| { .ok_or_else(|| io::Error::other("Password not found in `git credential fill` output"))
io::Error::other("Password not found in `git credential fill` output")
})
} }
trait CommandExt { trait CommandExt {
@ -83,9 +81,10 @@ impl CommandExt for Command {
} else { } else {
zeroize_and_drop(stdout); zeroize_and_drop(stdout);
Err(io::Error::other( Err(io::Error::other(format!(
format!("`{:?}` process exited with `{status}`", self.as_std()), "`{:?}` process exited with `{status}`",
)) self.as_std()
)))
} }
} }
} }