fix: construct path first
This commit is contained in:
parent
38e7895b71
commit
c468006904
@ -8,10 +8,11 @@ pub async fn read_certs(
|
|||||||
ca: &PublicKey,
|
ca: &PublicKey,
|
||||||
path: impl AsRef<Path>,
|
path: impl AsRef<Path>,
|
||||||
) -> anyhow::Result<Vec<Certificate>> {
|
) -> anyhow::Result<Vec<Certificate>> {
|
||||||
if !path.as_ref().exists() {
|
let ca_dir = path.as_ref().join(ca_dir(ca));
|
||||||
|
if !ca_dir.exists() {
|
||||||
return Ok(Vec::new());
|
return Ok(Vec::new());
|
||||||
}
|
}
|
||||||
read_dir(path.as_ref().join(ca_dir(ca))).await
|
read_dir(&ca_dir).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument]
|
#[instrument]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user