refactoring: change function name
This commit is contained in:
@@ -8,7 +8,7 @@ pub struct SingletonReader {
|
|||||||
pub whitelist: Vec<Vec<String>>,
|
pub whitelist: Vec<Vec<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_instance() -> Box<SingletonReader> {
|
pub fn singleton() -> Box<SingletonReader> {
|
||||||
static mut SINGLETON: Option<Box<SingletonReader>> = Option::None;
|
static mut SINGLETON: Option<Box<SingletonReader>> = Option::None;
|
||||||
static ONCE: Once = Once::new();
|
static ONCE: Once = Once::new();
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pub fn check_command(
|
|||||||
let mut base64 = "".to_string();
|
let mut base64 = "".to_string();
|
||||||
|
|
||||||
let empty = "".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);
|
let r_str = line.get(0).unwrap_or(&empty);
|
||||||
if r_str.is_empty() {
|
if r_str.is_empty() {
|
||||||
continue;
|
continue;
|
||||||
@@ -151,7 +151,7 @@ fn check_obfu(string: &str) -> std::string::String {
|
|||||||
fn check_regex(string: &str, r#type: usize) -> std::string::String {
|
fn check_regex(string: &str, r#type: usize) -> std::string::String {
|
||||||
let empty = "".to_string();
|
let empty = "".to_string();
|
||||||
let mut regextext = "".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);
|
let type_str = line.get(0).unwrap_or(&empty);
|
||||||
if type_str != &r#type.to_string() {
|
if type_str != &r#type.to_string() {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user