Pluralize lint name
This commit is contained in:
parent
1f577c0300
commit
c7445d7f2c
@ -2008,7 +2008,7 @@ Released 2018-09-13
|
||||
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
|
||||
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
|
||||
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
|
||||
[`unnecessary_wrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wrap
|
||||
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
|
||||
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
|
||||
[`unneeded_wildcard_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_wildcard_pattern
|
||||
[`unnested_or_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
|
||||
|
@ -323,7 +323,7 @@ mod unicode;
|
||||
mod unit_return_expecting_ord;
|
||||
mod unnamed_address;
|
||||
mod unnecessary_sort_by;
|
||||
mod unnecessary_wrap;
|
||||
mod unnecessary_wraps;
|
||||
mod unnested_or_patterns;
|
||||
mod unsafe_removed_from_name;
|
||||
mod unused_io_amount;
|
||||
@ -893,7 +893,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
&unnamed_address::FN_ADDRESS_COMPARISONS,
|
||||
&unnamed_address::VTABLE_ADDRESS_COMPARISONS,
|
||||
&unnecessary_sort_by::UNNECESSARY_SORT_BY,
|
||||
&unnecessary_wrap::UNNECESSARY_WRAP,
|
||||
&unnecessary_wraps::UNNECESSARY_WRAPS,
|
||||
&unnested_or_patterns::UNNESTED_OR_PATTERNS,
|
||||
&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
|
||||
&unused_io_amount::UNUSED_IO_AMOUNT,
|
||||
@ -1066,7 +1066,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
store.register_late_pass(|| box redundant_clone::RedundantClone);
|
||||
store.register_late_pass(|| box slow_vector_initialization::SlowVectorInit);
|
||||
store.register_late_pass(|| box unnecessary_sort_by::UnnecessarySortBy);
|
||||
store.register_late_pass(|| box unnecessary_wrap::UnnecessaryWrap);
|
||||
store.register_late_pass(|| box unnecessary_wraps::UnnecessaryWraps);
|
||||
store.register_late_pass(|| box types::RefToMut);
|
||||
store.register_late_pass(|| box assertions_on_constants::AssertionsOnConstants);
|
||||
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:
|
||||
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_wrap::UNNECESSARY_WRAP),
|
||||
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),
|
||||
@ -1779,7 +1779,7 @@ 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_wrap::UNNECESSARY_WRAP),
|
||||
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),
|
||||
|
@ -46,14 +46,14 @@ declare_clippy_lint! {
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
pub UNNECESSARY_WRAP,
|
||||
pub UNNECESSARY_WRAPS,
|
||||
complexity,
|
||||
"functions that only return `Ok` or `Some`"
|
||||
}
|
||||
|
||||
declare_lint_pass!(UnnecessaryWrap => [UNNECESSARY_WRAP]);
|
||||
declare_lint_pass!(UnnecessaryWraps => [UNNECESSARY_WRAPS]);
|
||||
|
||||
impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
|
||||
impl<'tcx> LateLintPass<'tcx> for UnnecessaryWraps {
|
||||
fn check_fn(
|
||||
&mut self,
|
||||
cx: &LateContext<'tcx>,
|
||||
@ -107,7 +107,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
|
||||
if can_sugg && !suggs.is_empty() {
|
||||
span_lint_and_then(
|
||||
cx,
|
||||
UNNECESSARY_WRAP,
|
||||
UNNECESSARY_WRAPS,
|
||||
span,
|
||||
format!(
|
||||
"this function's return value is unnecessarily wrapped by `{}`",
|
@ -2609,11 +2609,11 @@ vec![
|
||||
module: "unwrap",
|
||||
},
|
||||
Lint {
|
||||
name: "unnecessary_wrap",
|
||||
name: "unnecessary_wraps",
|
||||
group: "complexity",
|
||||
desc: "functions that only return `Ok` or `Some`",
|
||||
deprecation: None,
|
||||
module: "unnecessary_wrap",
|
||||
module: "unnecessary_wraps",
|
||||
},
|
||||
Lint {
|
||||
name: "unneeded_field_pattern",
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![warn(clippy::derive_ord_xor_partial_ord)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
use std::cmp::Ordering;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// edition:2018
|
||||
#![warn(clippy::missing_errors_doc)]
|
||||
#![allow(clippy::result_unit_err)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
use std::io;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![warn(clippy::drop_ref)]
|
||||
#![allow(clippy::toplevel_ref_arg)]
|
||||
#![allow(clippy::map_err_ignore)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
use std::mem::drop;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![warn(clippy::forget_ref)]
|
||||
#![allow(clippy::toplevel_ref_arg)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
use std::mem::forget;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![warn(clippy::let_underscore_must_use)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
// Debug implementations can fire this lint,
|
||||
// so we shouldn't lint external macros
|
||||
|
@ -1,6 +1,6 @@
|
||||
// run-rustfix
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_variables, clippy::unnecessary_wrap)]
|
||||
#![allow(unused_variables, clippy::unnecessary_wraps)]
|
||||
|
||||
fn option_unwrap_or() {
|
||||
// int case
|
||||
|
@ -1,6 +1,6 @@
|
||||
// run-rustfix
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_variables, clippy::unnecessary_wrap)]
|
||||
#![allow(unused_variables, clippy::unnecessary_wraps)]
|
||||
|
||||
fn option_unwrap_or() {
|
||||
// int case
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![warn(clippy::map_err_ignore)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
use std::convert::TryFrom;
|
||||
use std::error::Error;
|
||||
use std::fmt;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#![allow(clippy::let_underscore_drop)]
|
||||
#![allow(clippy::missing_docs_in_private_items)]
|
||||
#![allow(clippy::map_identity)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn main() {
|
||||
// mapping to Option on Iterator
|
||||
|
@ -4,7 +4,7 @@
|
||||
#![allow(clippy::let_underscore_drop)]
|
||||
#![allow(clippy::missing_docs_in_private_items)]
|
||||
#![allow(clippy::map_identity)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn main() {
|
||||
// mapping to Option on Iterator
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![warn(clippy::needless_lifetimes)]
|
||||
#![allow(dead_code, clippy::needless_pass_by_value, clippy::unnecessary_wrap)]
|
||||
#![allow(dead_code, clippy::needless_pass_by_value, clippy::unnecessary_wraps)]
|
||||
|
||||
fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#![warn(clippy::option_map_unit_fn)]
|
||||
#![allow(unused)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn do_nothing<T>(_: T) {}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#![warn(clippy::option_map_unit_fn)]
|
||||
#![allow(unused)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn do_nothing<T>(_: T) {}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![deny(clippy::option_option)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn input(_: Option<Option<u8>>) {}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#![warn(clippy::or_fun_call)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::HashMap;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#![warn(clippy::or_fun_call)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::HashMap;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![warn(clippy::panic_in_result_fn)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
struct A;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// run-rustfix
|
||||
#![allow(unreachable_code)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn some_func(a: Option<u32>) -> Option<u32> {
|
||||
a?;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// run-rustfix
|
||||
#![allow(unreachable_code)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn some_func(a: Option<u32>) -> Option<u32> {
|
||||
if a.is_none() {
|
||||
|
@ -7,7 +7,7 @@
|
||||
unused_must_use,
|
||||
clippy::needless_bool,
|
||||
clippy::match_like_matches_macro,
|
||||
clippy::unnecessary_wrap,
|
||||
clippy::unnecessary_wraps,
|
||||
deprecated
|
||||
)]
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
unused_must_use,
|
||||
clippy::needless_bool,
|
||||
clippy::match_like_matches_macro,
|
||||
clippy::unnecessary_wrap,
|
||||
clippy::unnecessary_wraps,
|
||||
deprecated
|
||||
)]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
#[warn(clippy::result_unit_err)]
|
||||
#[allow(unused)]
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// aux-build:macro_rules.rs
|
||||
|
||||
#![deny(clippy::try_err)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate macro_rules;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// aux-build:macro_rules.rs
|
||||
|
||||
#![deny(clippy::try_err)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate macro_rules;
|
||||
|
@ -4,7 +4,7 @@
|
||||
unused_must_use,
|
||||
unused_variables,
|
||||
clippy::unused_unit,
|
||||
clippy::unnecessary_wrap,
|
||||
clippy::unnecessary_wraps,
|
||||
clippy::or_fun_call
|
||||
)]
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// does not test any rustfixable lints
|
||||
|
||||
#![warn(clippy::clone_on_ref_ptr)]
|
||||
#![allow(unused, clippy::redundant_clone, clippy::unnecessary_wrap)]
|
||||
#![allow(unused, clippy::redundant_clone, clippy::unnecessary_wraps)]
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::rc::{self, Rc};
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![warn(clippy::unnecessary_wrap)]
|
||||
#![warn(clippy::unnecessary_wraps)]
|
||||
#![allow(clippy::no_effect)]
|
||||
#![allow(clippy::needless_return)]
|
||||
#![allow(clippy::if_same_then_else)]
|
@ -1,5 +1,5 @@
|
||||
error: this function's return value is unnecessarily wrapped by `Option`
|
||||
--> $DIR/unnecessary_wrap.rs:8:1
|
||||
--> $DIR/unnecessary_wraps.rs:8:1
|
||||
|
|
||||
LL | / fn func1(a: bool, b: bool) -> Option<i32> {
|
||||
LL | | if a && b {
|
||||
@ -10,7 +10,7 @@ LL | | }
|
||||
LL | | }
|
||||
| |_^
|
||||
|
|
||||
= note: `-D clippy::unnecessary-wrap` implied by `-D warnings`
|
||||
= note: `-D clippy::unnecessary-wraps` implied by `-D warnings`
|
||||
help: remove `Option` from the return type...
|
||||
|
|
||||
LL | fn func1(a: bool, b: bool) -> i32 {
|
||||
@ -26,7 +26,7 @@ LL | } else {
|
||||
...
|
||||
|
||||
error: this function's return value is unnecessarily wrapped by `Option`
|
||||
--> $DIR/unnecessary_wrap.rs:21:1
|
||||
--> $DIR/unnecessary_wraps.rs:21:1
|
||||
|
|
||||
LL | / fn func2(a: bool, b: bool) -> Option<i32> {
|
||||
LL | | if a && b {
|
||||
@ -52,7 +52,7 @@ LL | 30
|
||||
|
|
||||
|
||||
error: this function's return value is unnecessarily wrapped by `Option`
|
||||
--> $DIR/unnecessary_wrap.rs:51:1
|
||||
--> $DIR/unnecessary_wraps.rs:51:1
|
||||
|
|
||||
LL | / fn func5() -> Option<i32> {
|
||||
LL | | Some(1)
|
||||
@ -69,7 +69,7 @@ LL | 1
|
||||
|
|
||||
|
||||
error: this function's return value is unnecessarily wrapped by `Result`
|
||||
--> $DIR/unnecessary_wrap.rs:61:1
|
||||
--> $DIR/unnecessary_wraps.rs:61:1
|
||||
|
|
||||
LL | / fn func7() -> Result<i32, ()> {
|
||||
LL | | Ok(1)
|
||||
@ -86,7 +86,7 @@ LL | 1
|
||||
|
|
||||
|
||||
error: this function's return value is unnecessarily wrapped by `Option`
|
||||
--> $DIR/unnecessary_wrap.rs:93:5
|
||||
--> $DIR/unnecessary_wraps.rs:93:5
|
||||
|
|
||||
LL | / fn func12() -> Option<i32> {
|
||||
LL | | Some(1)
|
@ -1,7 +1,7 @@
|
||||
// run-rustfix
|
||||
|
||||
#![deny(clippy::useless_conversion)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn test_generic<T: Copy>(val: T) -> T {
|
||||
let _ = val;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// run-rustfix
|
||||
|
||||
#![deny(clippy::useless_conversion)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
fn test_generic<T: Copy>(val: T) -> T {
|
||||
let _ = T::from(val);
|
||||
|
@ -4,7 +4,7 @@
|
||||
#![warn(clippy::wildcard_imports)]
|
||||
//#![allow(clippy::redundant_pub_crate)]
|
||||
#![allow(unused)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
#![warn(unused_imports)]
|
||||
|
||||
extern crate wildcard_imports_helper;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#![warn(clippy::wildcard_imports)]
|
||||
//#![allow(clippy::redundant_pub_crate)]
|
||||
#![allow(unused)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
#![warn(unused_imports)]
|
||||
|
||||
extern crate wildcard_imports_helper;
|
||||
|
Loading…
Reference in New Issue
Block a user