Update rustfs/src/utils.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
houseme
2025-04-02 01:12:43 +08:00
committed by GitHub
parent 15efeb572f
commit b365aab902

View File

@@ -28,7 +28,10 @@ pub(crate) fn load_private_key(filename: &str) -> io::Result<PrivateKeyDer<'stat
let mut reader = io::BufReader::new(keyfile);
// Load and return a single private key.
private_key(&mut reader).map(|key| key.unwrap())
match private_key(&mut reader) {
Some(key) => Ok(key),
None => Err(error(format!("no private key found in {}", filename))),
}
}
pub(crate) fn error(err: String) -> io::Error {