Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pmnoxx committed Dec 24, 2021
1 parent ab77c92 commit 8b19845
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions clippy_lints/src/methods/unwrap_or_else_default.rs
Expand Up @@ -5,8 +5,6 @@ use clippy_utils::{
diagnostics::span_lint_and_sugg, is_default_equivalent_ctor, is_diag_trait_item, is_trait_item,
source::snippet_with_applicability, ty::is_type_diagnostic_item,
};
use rustc_hir::ExprKind;

use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_lint::LateContext;
Expand All @@ -26,7 +24,7 @@ pub(super) fn check<'tcx>(
let is_result = is_type_diagnostic_item(cx, recv_ty, sym::Result);

let is_default_eq = match &u_arg.kind {
ExprKind::Path(qpath) => {
hir::ExprKind::Path(qpath) => {
if let Some(repl_def_id) = cx.qpath_res(qpath, u_arg.hir_id).opt_def_id() {
if is_diag_trait_item(cx, repl_def_id, sym::Default)
|| is_default_equivalent_ctor(cx, repl_def_id, qpath)
Expand Down

0 comments on commit 8b19845

Please sign in to comment.