diff options
| author | Piotr Mikulski <piotr@near.org> | 2021-12-23 21:44:13 -0800 |
|---|---|---|
| committer | Piotr Mikulski <piotr@near.org> | 2021-12-23 21:44:13 -0800 |
| commit | ab77c924e9e26dcaa28c0eb861d08eb3ee998b6c (patch) | |
| tree | eec3f23add221827510af9117d05d2a228021028 | |
| parent | db236e668cfd3f3be6377ba9d2e3359804f53544 (diff) | |
| download | rust-ab77c924e9e26dcaa28c0eb861d08eb3ee998b6c.tar.gz rust-ab77c924e9e26dcaa28c0eb861d08eb3ee998b6c.zip | |
cargo dev fmt
| -rw-r--r-- | clippy_lints/src/methods/unwrap_or_else_default.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clippy_lints/src/methods/unwrap_or_else_default.rs b/clippy_lints/src/methods/unwrap_or_else_default.rs index 5f04d8e1828..e8827b1e5af 100644 --- a/clippy_lints/src/methods/unwrap_or_else_default.rs +++ b/clippy_lints/src/methods/unwrap_or_else_default.rs @@ -1,8 +1,9 @@ //! Lint for `some_result_or_option.unwrap_or_else(Default::default)` use super::UNWRAP_OR_ELSE_DEFAULT; -use clippy_utils::{diagnostics::span_lint_and_sugg, is_trait_item, source::snippet_with_applicability, ty::is_type_diagnostic_item, - is_default_equivalent_ctor, is_diag_trait_item +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; @@ -28,7 +29,8 @@ pub(super) fn check<'tcx>( 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) { + || is_default_equivalent_ctor(cx, repl_def_id, qpath) + { true } else { false @@ -37,7 +39,7 @@ pub(super) fn check<'tcx>( false } }, - _ => {false} + _ => false, }; if_chain! { |
