Something went wrong. Try again.
Lints and suggestions for the Nix programming language
Something went wrong. Try again.
123456789101112131415161718192021222324252627use std::collections::HashMap;
use lib::{LINTS, Lint};use rnix::SyntaxKind;
#[allow(clippy::borrowed_box)]pub fn lint_map_of( lints: &[&'static Box<dyn Lint>],) -> HashMap<SyntaxKind, Vec<&'static Box<dyn Lint>>> { let mut map = HashMap::new(); for lint in lints { let lint = *lint; let matches = lint.match_kind(); for m in matches { map.entry(m) .and_modify(|v: &mut Vec<_>| v.push(lint)) .or_insert_with(|| vec![lint]); } } map}
#[allow(clippy::borrowed_box)]pub fn lint_map() -> HashMap<SyntaxKind, Vec<&'static Box<dyn Lint>>> { lint_map_of(&LINTS)}