Skip to content

Commit 26e7bec

Browse files
committed
Pluralize lint name
1 parent 2881bbd commit 26e7bec

36 files changed

+49
-49
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2008,7 +2008,7 @@ Released 2018-09-13
20082008
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
20092009
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
20102010
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
2011-
[`unnecessary_wrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wrap
2011+
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
20122012
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
20132013
[`unneeded_wildcard_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_wildcard_pattern
20142014
[`unnested_or_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns

clippy_lints/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ mod unicode;
323323
mod unit_return_expecting_ord;
324324
mod unnamed_address;
325325
mod unnecessary_sort_by;
326-
mod unnecessary_wrap;
326+
mod unnecessary_wraps;
327327
mod unnested_or_patterns;
328328
mod unsafe_removed_from_name;
329329
mod unused_io_amount;
@@ -893,7 +893,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
893893
&unnamed_address::FN_ADDRESS_COMPARISONS,
894894
&unnamed_address::VTABLE_ADDRESS_COMPARISONS,
895895
&unnecessary_sort_by::UNNECESSARY_SORT_BY,
896-
&unnecessary_wrap::UNNECESSARY_WRAP,
896+
&unnecessary_wraps::UNNECESSARY_WRAPS,
897897
&unnested_or_patterns::UNNESTED_OR_PATTERNS,
898898
&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
899899
&unused_io_amount::UNUSED_IO_AMOUNT,
@@ -1066,7 +1066,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10661066
store.register_late_pass(|| box redundant_clone::RedundantClone);
10671067
store.register_late_pass(|| box slow_vector_initialization::SlowVectorInit);
10681068
store.register_late_pass(|| box unnecessary_sort_by::UnnecessarySortBy);
1069-
store.register_late_pass(|| box unnecessary_wrap::UnnecessaryWrap);
1069+
store.register_late_pass(|| box unnecessary_wraps::UnnecessaryWraps);
10701070
store.register_late_pass(|| box types::RefToMut);
10711071
store.register_late_pass(|| box assertions_on_constants::AssertionsOnConstants);
10721072
store.register_late_pass(|| box missing_const_for_fn::MissingConstForFn);
@@ -1574,7 +1574,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15741574
LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
15751575
LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
15761576
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
1577-
LintId::of(&unnecessary_wrap::UNNECESSARY_WRAP),
1577+
LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
15781578
LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
15791579
LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
15801580
LintId::of(&unused_unit::UNUSED_UNIT),
@@ -1779,7 +1779,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
17791779
LintId::of(&types::UNNECESSARY_CAST),
17801780
LintId::of(&types::VEC_BOX),
17811781
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
1782-
LintId::of(&unnecessary_wrap::UNNECESSARY_WRAP),
1782+
LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
17831783
LintId::of(&unwrap::UNNECESSARY_UNWRAP),
17841784
LintId::of(&useless_conversion::USELESS_CONVERSION),
17851785
LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),

clippy_lints/src/unnecessary_wrap.rs renamed to clippy_lints/src/unnecessary_wraps.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ declare_clippy_lint! {
4646
/// }
4747
/// }
4848
/// ```
49-
pub UNNECESSARY_WRAP,
49+
pub UNNECESSARY_WRAPS,
5050
complexity,
5151
"functions that only return `Ok` or `Some`"
5252
}
5353

54-
declare_lint_pass!(UnnecessaryWrap => [UNNECESSARY_WRAP]);
54+
declare_lint_pass!(UnnecessaryWraps => [UNNECESSARY_WRAPS]);
5555

56-
impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
56+
impl<'tcx> LateLintPass<'tcx> for UnnecessaryWraps {
5757
fn check_fn(
5858
&mut self,
5959
cx: &LateContext<'tcx>,
@@ -107,7 +107,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
107107
if can_sugg && !suggs.is_empty() {
108108
span_lint_and_then(
109109
cx,
110-
UNNECESSARY_WRAP,
110+
UNNECESSARY_WRAPS,
111111
span,
112112
format!(
113113
"this function's return value is unnecessarily wrapped by `{}`",

src/lintlist/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2609,11 +2609,11 @@ vec![
26092609
module: "unwrap",
26102610
},
26112611
Lint {
2612-
name: "unnecessary_wrap",
2612+
name: "unnecessary_wraps",
26132613
group: "complexity",
26142614
desc: "functions that only return `Ok` or `Some`",
26152615
deprecation: None,
2616-
module: "unnecessary_wrap",
2616+
module: "unnecessary_wraps",
26172617
},
26182618
Lint {
26192619
name: "unneeded_field_pattern",

tests/ui/derive_ord_xor_partial_ord.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::derive_ord_xor_partial_ord)]
2-
#![allow(clippy::unnecessary_wrap)]
2+
#![allow(clippy::unnecessary_wraps)]
33

44
use std::cmp::Ordering;
55

tests/ui/doc_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// edition:2018
22
#![warn(clippy::missing_errors_doc)]
33
#![allow(clippy::result_unit_err)]
4-
#![allow(clippy::unnecessary_wrap)]
4+
#![allow(clippy::unnecessary_wraps)]
55

66
use std::io;
77

tests/ui/drop_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![warn(clippy::drop_ref)]
22
#![allow(clippy::toplevel_ref_arg)]
33
#![allow(clippy::map_err_ignore)]
4-
#![allow(clippy::unnecessary_wrap)]
4+
#![allow(clippy::unnecessary_wraps)]
55

66
use std::mem::drop;
77

tests/ui/forget_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![warn(clippy::forget_ref)]
22
#![allow(clippy::toplevel_ref_arg)]
3-
#![allow(clippy::unnecessary_wrap)]
3+
#![allow(clippy::unnecessary_wraps)]
44

55
use std::mem::forget;
66

tests/ui/let_underscore_must_use.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::let_underscore_must_use)]
2-
#![allow(clippy::unnecessary_wrap)]
2+
#![allow(clippy::unnecessary_wraps)]
33

44
// Debug implementations can fire this lint,
55
// so we shouldn't lint external macros

tests/ui/manual_unwrap_or.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![allow(dead_code)]
3-
#![allow(unused_variables, clippy::unnecessary_wrap)]
3+
#![allow(unused_variables, clippy::unnecessary_wraps)]
44

55
fn option_unwrap_or() {
66
// int case

tests/ui/manual_unwrap_or.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![allow(dead_code)]
3-
#![allow(unused_variables, clippy::unnecessary_wrap)]
3+
#![allow(unused_variables, clippy::unnecessary_wraps)]
44

55
fn option_unwrap_or() {
66
// int case

tests/ui/map_err.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::map_err_ignore)]
2-
#![allow(clippy::unnecessary_wrap)]
2+
#![allow(clippy::unnecessary_wraps)]
33
use std::convert::TryFrom;
44
use std::error::Error;
55
use std::fmt;

tests/ui/map_flatten.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![allow(clippy::let_underscore_drop)]
55
#![allow(clippy::missing_docs_in_private_items)]
66
#![allow(clippy::map_identity)]
7-
#![allow(clippy::unnecessary_wrap)]
7+
#![allow(clippy::unnecessary_wraps)]
88

99
fn main() {
1010
// mapping to Option on Iterator

tests/ui/map_flatten.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![allow(clippy::let_underscore_drop)]
55
#![allow(clippy::missing_docs_in_private_items)]
66
#![allow(clippy::map_identity)]
7-
#![allow(clippy::unnecessary_wrap)]
7+
#![allow(clippy::unnecessary_wraps)]
88

99
fn main() {
1010
// mapping to Option on Iterator

tests/ui/needless_lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::needless_lifetimes)]
2-
#![allow(dead_code, clippy::needless_pass_by_value, clippy::unnecessary_wrap)]
2+
#![allow(dead_code, clippy::needless_pass_by_value, clippy::unnecessary_wraps)]
33

44
fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
55

tests/ui/option_map_unit_fn_fixable.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![warn(clippy::option_map_unit_fn)]
44
#![allow(unused)]
5-
#![allow(clippy::unnecessary_wrap)]
5+
#![allow(clippy::unnecessary_wraps)]
66

77
fn do_nothing<T>(_: T) {}
88

tests/ui/option_map_unit_fn_fixable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![warn(clippy::option_map_unit_fn)]
44
#![allow(unused)]
5-
#![allow(clippy::unnecessary_wrap)]
5+
#![allow(clippy::unnecessary_wraps)]
66

77
fn do_nothing<T>(_: T) {}
88

tests/ui/option_option.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![deny(clippy::option_option)]
2-
#![allow(clippy::unnecessary_wrap)]
2+
#![allow(clippy::unnecessary_wraps)]
33

44
fn input(_: Option<Option<u8>>) {}
55

tests/ui/or_fun_call.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![warn(clippy::or_fun_call)]
44
#![allow(dead_code)]
5-
#![allow(clippy::unnecessary_wrap)]
5+
#![allow(clippy::unnecessary_wraps)]
66

77
use std::collections::BTreeMap;
88
use std::collections::HashMap;

tests/ui/or_fun_call.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![warn(clippy::or_fun_call)]
44
#![allow(dead_code)]
5-
#![allow(clippy::unnecessary_wrap)]
5+
#![allow(clippy::unnecessary_wraps)]
66

77
use std::collections::BTreeMap;
88
use std::collections::HashMap;

tests/ui/panic_in_result_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::panic_in_result_fn)]
2-
#![allow(clippy::unnecessary_wrap)]
2+
#![allow(clippy::unnecessary_wraps)]
33

44
struct A;
55

tests/ui/question_mark.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![allow(unreachable_code)]
3-
#![allow(clippy::unnecessary_wrap)]
3+
#![allow(clippy::unnecessary_wraps)]
44

55
fn some_func(a: Option<u32>) -> Option<u32> {
66
a?;

tests/ui/question_mark.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![allow(unreachable_code)]
3-
#![allow(clippy::unnecessary_wrap)]
3+
#![allow(clippy::unnecessary_wraps)]
44

55
fn some_func(a: Option<u32>) -> Option<u32> {
66
if a.is_none() {

tests/ui/redundant_pattern_matching.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
unused_must_use,
88
clippy::needless_bool,
99
clippy::match_like_matches_macro,
10-
clippy::unnecessary_wrap,
10+
clippy::unnecessary_wraps,
1111
deprecated
1212
)]
1313

tests/ui/redundant_pattern_matching.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
unused_must_use,
88
clippy::needless_bool,
99
clippy::match_like_matches_macro,
10-
clippy::unnecessary_wrap,
10+
clippy::unnecessary_wraps,
1111
deprecated
1212
)]
1313

tests/ui/result_unit_error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::unnecessary_wrap)]
1+
#![allow(clippy::unnecessary_wraps)]
22
#[warn(clippy::result_unit_err)]
33
#[allow(unused)]
44

tests/ui/try_err.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// aux-build:macro_rules.rs
33

44
#![deny(clippy::try_err)]
5-
#![allow(clippy::unnecessary_wrap)]
5+
#![allow(clippy::unnecessary_wraps)]
66

77
#[macro_use]
88
extern crate macro_rules;

tests/ui/try_err.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// aux-build:macro_rules.rs
33

44
#![deny(clippy::try_err)]
5-
#![allow(clippy::unnecessary_wrap)]
5+
#![allow(clippy::unnecessary_wraps)]
66

77
#[macro_use]
88
extern crate macro_rules;

tests/ui/unit_arg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
unused_must_use,
55
unused_variables,
66
clippy::unused_unit,
7-
clippy::unnecessary_wrap,
7+
clippy::unnecessary_wraps,
88
clippy::or_fun_call
99
)]
1010

tests/ui/unnecessary_clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// does not test any rustfixable lints
22

33
#![warn(clippy::clone_on_ref_ptr)]
4-
#![allow(unused, clippy::redundant_clone, clippy::unnecessary_wrap)]
4+
#![allow(unused, clippy::redundant_clone, clippy::unnecessary_wraps)]
55

66
use std::cell::RefCell;
77
use std::rc::{self, Rc};

tests/ui/unnecessary_wrap.rs renamed to tests/ui/unnecessary_wraps.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::unnecessary_wrap)]
1+
#![warn(clippy::unnecessary_wraps)]
22
#![allow(clippy::no_effect)]
33
#![allow(clippy::needless_return)]
44
#![allow(clippy::if_same_then_else)]

tests/ui/unnecessary_wrap.stderr renamed to tests/ui/unnecessary_wraps.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this function's return value is unnecessarily wrapped by `Option`
2-
--> $DIR/unnecessary_wrap.rs:8:1
2+
--> $DIR/unnecessary_wraps.rs:8:1
33
|
44
LL | / fn func1(a: bool, b: bool) -> Option<i32> {
55
LL | | if a && b {
@@ -10,7 +10,7 @@ LL | | }
1010
LL | | }
1111
| |_^
1212
|
13-
= note: `-D clippy::unnecessary-wrap` implied by `-D warnings`
13+
= note: `-D clippy::unnecessary-wraps` implied by `-D warnings`
1414
help: remove `Option` from the return type...
1515
|
1616
LL | fn func1(a: bool, b: bool) -> i32 {
@@ -26,7 +26,7 @@ LL | } else {
2626
...
2727

2828
error: this function's return value is unnecessarily wrapped by `Option`
29-
--> $DIR/unnecessary_wrap.rs:21:1
29+
--> $DIR/unnecessary_wraps.rs:21:1
3030
|
3131
LL | / fn func2(a: bool, b: bool) -> Option<i32> {
3232
LL | | if a && b {
@@ -52,7 +52,7 @@ LL | 30
5252
|
5353

5454
error: this function's return value is unnecessarily wrapped by `Option`
55-
--> $DIR/unnecessary_wrap.rs:51:1
55+
--> $DIR/unnecessary_wraps.rs:51:1
5656
|
5757
LL | / fn func5() -> Option<i32> {
5858
LL | | Some(1)
@@ -69,7 +69,7 @@ LL | 1
6969
|
7070

7171
error: this function's return value is unnecessarily wrapped by `Result`
72-
--> $DIR/unnecessary_wrap.rs:61:1
72+
--> $DIR/unnecessary_wraps.rs:61:1
7373
|
7474
LL | / fn func7() -> Result<i32, ()> {
7575
LL | | Ok(1)
@@ -86,7 +86,7 @@ LL | 1
8686
|
8787

8888
error: this function's return value is unnecessarily wrapped by `Option`
89-
--> $DIR/unnecessary_wrap.rs:93:5
89+
--> $DIR/unnecessary_wraps.rs:93:5
9090
|
9191
LL | / fn func12() -> Option<i32> {
9292
LL | | Some(1)

tests/ui/useless_conversion.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-rustfix
22

33
#![deny(clippy::useless_conversion)]
4-
#![allow(clippy::unnecessary_wrap)]
4+
#![allow(clippy::unnecessary_wraps)]
55

66
fn test_generic<T: Copy>(val: T) -> T {
77
let _ = val;

tests/ui/useless_conversion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-rustfix
22

33
#![deny(clippy::useless_conversion)]
4-
#![allow(clippy::unnecessary_wrap)]
4+
#![allow(clippy::unnecessary_wraps)]
55

66
fn test_generic<T: Copy>(val: T) -> T {
77
let _ = T::from(val);

tests/ui/wildcard_imports.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![warn(clippy::wildcard_imports)]
55
//#![allow(clippy::redundant_pub_crate)]
66
#![allow(unused)]
7-
#![allow(clippy::unnecessary_wrap)]
7+
#![allow(clippy::unnecessary_wraps)]
88
#![warn(unused_imports)]
99

1010
extern crate wildcard_imports_helper;

0 commit comments

Comments
 (0)