Skip to content

Commit 8a47901

Browse files
committed
Auto merge of #6765 - camsteffen:unnecessary-wraps-pedantic, r=flip1995
Change unnecessary_wraps to pedantic changelog: Change unnecessary_wraps to pedantic There seems to be enough evidence that this lint is not wanted as warn-by-default. Attempted before at #6380. False positives at #6721 and #6427. Actually requested to change the category at #6726. Closes #6726
2 parents d2ddf9c + 46c91db commit 8a47901

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13961396
LintId::of(&types::PTR_AS_PTR),
13971397
LintId::of(&unicode::NON_ASCII_LITERAL),
13981398
LintId::of(&unicode::UNICODE_NOT_NFC),
1399+
LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
13991400
LintId::of(&unnested_or_patterns::UNNESTED_OR_PATTERNS),
14001401
LintId::of(&unused_self::UNUSED_SELF),
14011402
LintId::of(&wildcard_imports::ENUM_GLOB_USE),
@@ -1690,7 +1691,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
16901691
LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
16911692
LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
16921693
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
1693-
LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
16941694
LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
16951695
LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
16961696
LintId::of(&unused_unit::UNUSED_UNIT),
@@ -1908,7 +1908,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
19081908
LintId::of(&types::UNNECESSARY_CAST),
19091909
LintId::of(&types::VEC_BOX),
19101910
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
1911-
LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
19121911
LintId::of(&unwrap::UNNECESSARY_UNWRAP),
19131912
LintId::of(&useless_conversion::USELESS_CONVERSION),
19141913
LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),

clippy_lints/src/unnecessary_wraps.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ declare_clippy_lint! {
1717
///
1818
/// **Why is this bad?** It is not meaningful to wrap values when no `None` or `Err` is returned.
1919
///
20-
/// **Known problems:** Since this lint changes function type signature, you may need to
21-
/// adjust some code at callee side.
20+
/// **Known problems:** There can be false positives if the function signature is designed to
21+
/// fit some external requirement.
2222
///
2323
/// **Example:**
2424
///
@@ -48,7 +48,7 @@ declare_clippy_lint! {
4848
/// }
4949
/// ```
5050
pub UNNECESSARY_WRAPS,
51-
complexity,
51+
pedantic,
5252
"functions that only return `Ok` or `Some`"
5353
}
5454

0 commit comments

Comments
 (0)