From 54c6054ec72c7ec8babd95324059713abdfa74f7 Mon Sep 17 00:00:00 2001 From: Cameron Steffen Date: Thu, 18 Feb 2021 20:02:58 -0600 Subject: [PATCH 1/2] Change unnecessary_wraps to pedantic --- clippy_lints/src/lib.rs | 3 +-- clippy_lints/src/unnecessary_wraps.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 407279806939..102a5f05d738 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1393,6 +1393,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&types::PTR_AS_PTR), LintId::of(&unicode::NON_ASCII_LITERAL), LintId::of(&unicode::UNICODE_NOT_NFC), + LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS), LintId::of(&unnested_or_patterns::UNNESTED_OR_PATTERNS), LintId::of(&unused_self::UNUSED_SELF), LintId::of(&wildcard_imports::ENUM_GLOB_USE), @@ -1686,7 +1687,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS), LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS), LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY), - LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS), LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME), LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT), LintId::of(&unused_unit::UNUSED_UNIT), @@ -1903,7 +1903,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&types::UNNECESSARY_CAST), LintId::of(&types::VEC_BOX), LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY), - LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS), LintId::of(&unwrap::UNNECESSARY_UNWRAP), LintId::of(&useless_conversion::USELESS_CONVERSION), LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO), diff --git a/clippy_lints/src/unnecessary_wraps.rs b/clippy_lints/src/unnecessary_wraps.rs index 8ac5dd696b76..0e78c76a7d1c 100644 --- a/clippy_lints/src/unnecessary_wraps.rs +++ b/clippy_lints/src/unnecessary_wraps.rs @@ -48,7 +48,7 @@ declare_clippy_lint! { /// } /// ``` pub UNNECESSARY_WRAPS, - complexity, + pedantic, "functions that only return `Ok` or `Some`" } From 46c91db1e1c1f497854069d78e522bc5ff6bf0f7 Mon Sep 17 00:00:00 2001 From: Cameron Steffen Date: Thu, 18 Feb 2021 20:23:49 -0600 Subject: [PATCH 2/2] Change known problems --- clippy_lints/src/unnecessary_wraps.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/unnecessary_wraps.rs b/clippy_lints/src/unnecessary_wraps.rs index 0e78c76a7d1c..9c0c21b9bc77 100644 --- a/clippy_lints/src/unnecessary_wraps.rs +++ b/clippy_lints/src/unnecessary_wraps.rs @@ -17,8 +17,8 @@ declare_clippy_lint! { /// /// **Why is this bad?** It is not meaningful to wrap values when no `None` or `Err` is returned. /// - /// **Known problems:** Since this lint changes function type signature, you may need to - /// adjust some code at callee side. + /// **Known problems:** There can be false positives if the function signature is designed to + /// fit some external requirement. /// /// **Example:** ///