diff --git a/src/detections/configs.rs b/src/detections/configs.rs index 82c273de..1862e2d4 100644 --- a/src/detections/configs.rs +++ b/src/detections/configs.rs @@ -8,7 +8,7 @@ pub struct SingletonReader { pub whitelist: Vec>, } -pub fn get_instance() -> Box { +pub fn singleton() -> Box { static mut SINGLETON: Option> = Option::None; static ONCE: Once = Once::new(); diff --git a/src/detections/utils.rs b/src/detections/utils.rs index daf68bbb..ef888f52 100644 --- a/src/detections/utils.rs +++ b/src/detections/utils.rs @@ -21,7 +21,7 @@ pub fn check_command( let mut base64 = "".to_string(); let empty = "".to_string(); - for line in configs::get_instance().whitelist { + for line in configs::singleton().whitelist { let r_str = line.get(0).unwrap_or(&empty); if r_str.is_empty() { continue; @@ -151,7 +151,7 @@ fn check_obfu(string: &str) -> std::string::String { fn check_regex(string: &str, r#type: usize) -> std::string::String { let empty = "".to_string(); let mut regextext = "".to_string(); - for line in configs::get_instance().regex { + for line in configs::singleton().regex { let type_str = line.get(0).unwrap_or(&empty); if type_str != &r#type.to_string() { continue;