diff --git a/src/c_macro.rs b/src/c_macro.rs index a7a7c824e..d5334e9d7 100644 --- a/src/c_macro.rs +++ b/src/c_macro.rs @@ -14,11 +14,14 @@ fn is_identifier_starter(c: u8) -> bool { } #[inline(always)] -fn is_macro(mac: &str, macros: &HashSet) -> bool { +fn is_macro(mac: &str, macros: &HashSet) -> bool { macros.contains(mac) || PREDEFINED_MACROS.contains(mac) } -pub fn replace(code: &[u8], macros: &HashSet) -> Option> { +pub fn replace( + code: &[u8], + macros: &HashSet, +) -> Option> { let mut new_code = Vec::with_capacity(code.len()); let mut code_start = 0; let mut k_start = 0; diff --git a/src/lib.rs b/src/lib.rs index 4e0e439c8..b35cdb9ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::implicit_hasher)] - #[macro_use] extern crate lazy_static; #[macro_use] diff --git a/src/preproc.rs b/src/preproc.rs index bb84eff83..f99260205 100644 --- a/src/preproc.rs +++ b/src/preproc.rs @@ -34,7 +34,10 @@ impl PreprocFile { } } -pub fn get_macros(file: &PathBuf, files: &HashMap) -> HashSet { +pub fn get_macros( + file: &PathBuf, + files: &HashMap, +) -> HashSet { let mut macros = HashSet::new(); if let Some(pf) = files.get(file) { for m in pf.macros.iter() { @@ -51,9 +54,9 @@ pub fn get_macros(file: &PathBuf, files: &HashMap) -> Hash macros } -pub fn fix_includes( - files: &mut HashMap, - all_files: &HashMap>, +pub fn fix_includes( + files: &mut HashMap, + all_files: &HashMap, S>, ) { let mut nodes: HashMap = HashMap::new(); // Since we'll remove strong connected components we need to have a stable graph diff --git a/src/tools.rs b/src/tools.rs index 85b623d49..33ce0ddef 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -185,10 +185,10 @@ pub fn get_paths_dist(path1: &PathBuf, path2: &PathBuf) -> Option { None } -pub fn guess_file( +pub fn guess_file( current_path: &PathBuf, include_path: &str, - all_files: &HashMap>, + all_files: &HashMap, S>, ) -> Vec { //let rpath = include_path.clone(); let include_path = if include_path.starts_with("mozilla/") {