clippy_utils::ty

Function match_type

Source
pub fn match_type(cx: &LateContext<'_>, ty: Ty<'_>, path: &[&str]) -> bool
Expand description

Checks if type is struct, enum or union type with the given def path.

If the type is a diagnostic item, use is_type_diagnostic_item instead. If you change the signature, remember to update the internal lint MatchTypeOnDiagItem