fn check_use_box()

in gazebo_lint/src/lib.rs [403:416]


fn check_use_box(cx: &LateContext, expr: &Expr) {
    if let ExprKind::Call(call, args) = expr.kind {
        if args.len() == 1 {
            if let ExprKind::Path(qpath) = &call.kind {
                let res = cx.qpath_res(qpath, call.hir_id);
                if let Some(def_id) = res.opt_def_id() {
                    if clippy::match_def_path(cx, def_id, &["alloc", "boxed", "Box", "new"]) {
                        emit_lint(cx, GAZEBO_LINT_USE_BOX, expr.span);
                    }
                }
            }
        }
    }
}