rust/pvsecret: verify.rs: fix clippy finding

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-05-22 12:39:42 +00:00
committed by Steffen Eiden
parent 636d2d571b
commit 5648b924d6

View File

@@ -13,7 +13,7 @@ use crate::cli::VerifyOpt;
/// read the content of a DER or PEM x509 and return the public key
fn read_sgn_key(path: &str) -> Result<PKey<Public>> {
read_certs(&read_file(path, "user-signing key")?)?
.get(0)
.first()
.ok_or(anyhow!("File does not contain a X509 certificate"))?
.public_key()
.map_err(anyhow::Error::new)