rustqual 1.2.2

Comprehensive Rust code quality analyzer — seven dimensions: IOSP, Complexity, DRY, SRP, Coupling, Test Quality, Architecture
Documentation
//! Matchers for the Architecture-Dimension.
//!
//! Each matcher is an AST-level function that takes a parsed `syn::File`
//! (plus matcher-specific parameters) and returns all occurrences of a
//! rule violation as `MatchLocation` values.
//!
//! Matchers are pure (no I/O, no global state) so they can be unit-tested
//! in isolation with fixture source strings.

pub mod derive;
pub mod function_call;
pub mod glob_import;
pub mod item_kind;
pub mod macro_call;
pub mod method_call;
pub mod path_prefix;

pub use derive::find_derive_matches;
pub use function_call::find_function_call_matches;
pub use glob_import::find_glob_imports;
pub use item_kind::find_item_kind_matches;
pub use macro_call::find_macro_calls;
pub use method_call::find_method_call_matches;
pub use path_prefix::find_path_prefix_matches;

/// Render a `syn::Path` as `a::b::c`, dropping any turbofish/generic arguments.
pub(super) fn render_path(path: &syn::Path) -> String {
    path.segments
        .iter()
        .map(|s| s.ident.to_string())
        .collect::<Vec<_>>()
        .join("::")
}

#[cfg(test)]
mod tests;