mirror of
https://git.verdigado.com/NB-Public/simple-wkd.git
synced 2024-10-30 03:05:51 +01:00
Refactor validate_cert macro
This commit is contained in:
parent
f431246321
commit
2ce66b9ba0
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
||||||
use crate::errors::CompatErr;
|
use crate::errors::CompatErr;
|
||||||
use crate::errors::SpecialErrors;
|
use crate::errors::SpecialErrors;
|
||||||
use crate::settings::POLICY;
|
|
||||||
use crate::settings::ROOT_FOLDER;
|
use crate::settings::ROOT_FOLDER;
|
||||||
use crate::settings::SETTINGS;
|
use crate::settings::SETTINGS;
|
||||||
|
|
||||||
|
@ -24,13 +23,14 @@ use std::{
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! validate_cert {
|
macro_rules! validate_cert {
|
||||||
( $x:expr ) => {
|
( $x:expr ) => {
|
||||||
match $x.with_policy(POLICY, None) {
|
match $x.with_policy($crate::settings::POLICY, None) {
|
||||||
Ok(validcert) => Ok(validcert),
|
Ok(validcert) => Ok(validcert),
|
||||||
Err(_) => Err(SpecialErrors::InvalidCert),
|
Err(_) => Err($crate::errors::SpecialErrors::InvalidCert),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn pending_path() -> PathBuf {
|
pub fn pending_path() -> PathBuf {
|
||||||
Path::new(&ROOT_FOLDER).join("pending")
|
Path::new(&ROOT_FOLDER).join("pending")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue