From 01b179830d62f59014ed06e49a281384c6f38b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20P=C3=A9rez?= Date: Mon, 30 Sep 2024 14:44:25 +0100 Subject: [PATCH] chore: mark dead code --- src/defs/from_file.rs | 11 ++++++++--- src/defs/openid.rs | 8 +++++--- src/defs/req_handler.rs | 2 ++ src/defs/req_headermap.rs | 1 + 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/defs/from_file.rs b/src/defs/from_file.rs index 6b83f71..826927f 100644 --- a/src/defs/from_file.rs +++ b/src/defs/from_file.rs @@ -5,11 +5,14 @@ use serde::de::DeserializeOwned; use log::info; pub const CFG_FILE_EXTENSION: &str = ".toml"; - +/* +// To include DocServer as part of higher Application Definition pub trait AppDef { fn app_def(&mut self, root_path: String ); // -> T; } +*/ pub trait FromFile { + // To use with global AppDef root path fn fix_root_path(&mut self, root_path: String ); // -> T; } pub fn load_from_file<'a, T: FromFile + DeserializeOwned>(file_cfg: &str, name: &str) -> Result { @@ -41,6 +44,8 @@ pub fn load_from_file<'a, T: FromFile + DeserializeOwned>(file_cfg: &str, name: } pub trait DictFromFile { + #![allow(dead_code)] + // To include DocServer as part of Full Dictionaries Definition fn fix_root_path(&mut self, root_path: String ); // -> T; } pub fn load_dict_from_file<'a, T: DictFromFile + DeserializeOwned>(file_cfg: &str, name: &str) -> Result> { @@ -66,8 +71,8 @@ pub fn load_dict_from_file<'a, T: DictFromFile + DeserializeOwned>(file_cfg: &st }, Err(e) => { return Err(Error::new( - ErrorKind::InvalidInput, - format!("Error loading {} {}: {}",name,&file_path,e) + ErrorKind::InvalidInput, + format!("Error loading {} {}: {}",name,&file_path,e) )) }, }; diff --git a/src/defs/openid.rs b/src/defs/openid.rs index ea2fe5d..a492ca1 100644 --- a/src/defs/openid.rs +++ b/src/defs/openid.rs @@ -86,10 +86,12 @@ pub struct OpenidConf { pub signup_application: String, } +#[allow(dead_code)] + // To include DocServer as part of Full Dictionaries Definition pub struct OpenidCli { - pub client: CoreClient, - pub pk_challenge: PkceCodeChallenge, - pub pk_verifier: PkceCodeVerifier, + pub client: CoreClient, + pub pk_challenge: PkceCodeChallenge, + pub pk_verifier: PkceCodeVerifier, } pub struct OpenidClient { pub url: Url, diff --git a/src/defs/req_handler.rs b/src/defs/req_handler.rs index 553b1ac..d232ed6 100644 --- a/src/defs/req_handler.rs +++ b/src/defs/req_handler.rs @@ -34,6 +34,8 @@ use super::{CLAIM_UID, CLAIM_AUTH, CLAIM_APP_KEY}; pub struct ReqHandler<'a> { pub req_header: ReqHeaderMap, pub app_dbs: &'a AppDBs, + // To include DocServer as part of Full Dictionaries Definition + #[allow(dead_code)] pub lang: Local, pub uri: &'a Uri, pub auth_state: AuthState, diff --git a/src/defs/req_headermap.rs b/src/defs/req_headermap.rs index a9f4136..20b2292 100644 --- a/src/defs/req_headermap.rs +++ b/src/defs/req_headermap.rs @@ -22,6 +22,7 @@ use crate::defs::{ pub struct ReqHeaderMap { pub header: HeaderMap, + #[allow(dead_code)] pub req_path: Vec, pub app_connect_info: AppConnectInfo, }