fn check_anyhow_two_arguments()

in gazebo_lint/src/lib.rs [541:562]


fn check_anyhow_two_arguments(cx: &LateContext, ty: &Ty) {
    if let rustc_hir::TyKind::Path(QPath::Resolved(
        _,
        Path {
            res: Res::Def(DefKind::TyAlias, result),
            segments:
                [
                    _,
                    PathSegment {
                        args: Some(GenericArgs { args: [_, _], .. }),
                        ..
                    },
                ],
            ..
        },
    )) = &ty.kind
    {
        if clippy::match_def_path(cx, *result, &["anyhow", "Result"]) {
            emit_lint(cx, GAZEBO_LINT_ANYHOW_RESULT_TWO_ARGUMENTS, ty.span);
        }
    }
}