Skip to content

Commit ab77c92

Browse files
committed
cargo dev fmt
1 parent db236e6 commit ab77c92

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clippy_lints/src/methods/unwrap_or_else_default.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//! Lint for `some_result_or_option.unwrap_or_else(Default::default)`
22
33
use super::UNWRAP_OR_ELSE_DEFAULT;
4-
use clippy_utils::{diagnostics::span_lint_and_sugg, is_trait_item, source::snippet_with_applicability, ty::is_type_diagnostic_item,
5-
is_default_equivalent_ctor, is_diag_trait_item
4+
use clippy_utils::{
5+
diagnostics::span_lint_and_sugg, is_default_equivalent_ctor, is_diag_trait_item, is_trait_item,
6+
source::snippet_with_applicability, ty::is_type_diagnostic_item,
67
};
78
use rustc_hir::ExprKind;
89

@@ -28,7 +29,8 @@ pub(super) fn check<'tcx>(
2829
ExprKind::Path(qpath) => {
2930
if let Some(repl_def_id) = cx.qpath_res(qpath, u_arg.hir_id).opt_def_id() {
3031
if is_diag_trait_item(cx, repl_def_id, sym::Default)
31-
|| is_default_equivalent_ctor(cx, repl_def_id, qpath) {
32+
|| is_default_equivalent_ctor(cx, repl_def_id, qpath)
33+
{
3234
true
3335
} else {
3436
false
@@ -37,7 +39,7 @@ pub(super) fn check<'tcx>(
3739
false
3840
}
3941
},
40-
_ => {false}
42+
_ => false,
4143
};
4244

4345
if_chain! {

0 commit comments

Comments
 (0)