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
-5
@@ -173,12 +173,17 @@ impl CertVerifier {
|
||||
/// # Errors
|
||||
///
|
||||
/// This function will return an error if the chain of trust could not be established.
|
||||
pub fn new(
|
||||
cert_paths: &[&Path],
|
||||
crl_paths: &[&Path],
|
||||
root_ca_path: Option<&Path>,
|
||||
pub fn new<P, Q, R>(
|
||||
cert_paths: &[P],
|
||||
crl_paths: &[Q],
|
||||
root_ca_path: Option<R>,
|
||||
offline: bool,
|
||||
) -> Result<Self> {
|
||||
) -> Result<Self>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
Q: AsRef<Path>,
|
||||
R: AsRef<Path>,
|
||||
{
|
||||
let mut store = helper::store_setup(root_ca_path, crl_paths, cert_paths)?;
|
||||
let mut untr_certs = Vec::with_capacity(cert_paths.len());
|
||||
for path in cert_paths {
|
||||
|
||||
Reference in New Issue
Block a user