From 2ce66b9ba0915d3105c4672be22184bab8ad6c36 Mon Sep 17 00:00:00 2001 From: Delta1925 Date: Tue, 18 Apr 2023 19:42:26 +0200 Subject: [PATCH] Refactor validate_cert macro --- backend/src/utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/utils.rs b/backend/src/utils.rs index c985572..ede5acb 100644 --- a/backend/src/utils.rs +++ b/backend/src/utils.rs @@ -1,6 +1,5 @@ use crate::errors::CompatErr; use crate::errors::SpecialErrors; -use crate::settings::POLICY; use crate::settings::ROOT_FOLDER; use crate::settings::SETTINGS; @@ -24,13 +23,14 @@ use std::{ #[macro_export] macro_rules! validate_cert { ( $x:expr ) => { - match $x.with_policy(POLICY, None) { + match $x.with_policy($crate::settings::POLICY, None) { Ok(validcert) => Ok(validcert), - Err(_) => Err(SpecialErrors::InvalidCert), + Err(_) => Err($crate::errors::SpecialErrors::InvalidCert), } }; } + pub fn pending_path() -> PathBuf { Path::new(&ROOT_FOLDER).join("pending") }