mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
rust: Use AsRef<Path> and PathBuf in libraries
Use `AsRef<Path>` instead of `&Path`, &str, .... to be more versatile and accept more input types. In addition, use `PathBuf` and `Path` for paths instead of `String` and `str`. 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:
committed by
Steffen Eiden
parent
87d43c7a32
commit
4a76efe6d5
@@ -10,7 +10,7 @@ use utils::{get_reader_from_cli_file_arg, get_writer_from_cli_file_arg};
|
||||
|
||||
/// 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")?)?
|
||||
read_certs(read_file(path, "user-signing key")?)?
|
||||
.first()
|
||||
.ok_or(anyhow!("File does not contain a X509 certificate"))?
|
||||
.public_key()
|
||||
|
||||
Reference in New Issue
Block a user