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:
Marc Hartmayer
2024-05-23 16:32:57 +00:00
committed by Steffen Eiden
parent 87d43c7a32
commit 4a76efe6d5
13 changed files with 88 additions and 84 deletions

View File

@@ -2,6 +2,8 @@
//
// Copyright IBM Corp. 2023, 2024
use std::path::PathBuf;
use crate::secret::UserDataType;
/// Result type for this crate
@@ -26,7 +28,7 @@ pub enum Error {
#[error("Cannot load {ty} from {path}")]
X509Load {
path: String,
path: PathBuf,
ty: &'static str,
source: openssl::error::ErrorStack,
},