Skip to content

Commit

Permalink
Added the 's' to the end of the lint name
Browse files Browse the repository at this point in the history
  • Loading branch information
botahamec committed Jul 30, 2022
1 parent a3e7b36 commit 4a2a27d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3969,7 +3969,7 @@ Released 2018-09-13
[`unit_hash`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_hash
[`unit_return_expecting_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_return_expecting_ord
[`unknown_clippy_lints`]: https://rust-lang.github.io/rust-clippy/master/index.html#unknown_clippy_lints
[`unnecessary_box_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_box_return
[`unnecessary_box_returns`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_box_returns
[`unnecessary_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
[`unnecessary_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
[`unnecessary_find_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_find_map
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/lib.register_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ store.register_lints(&[
unit_types::UNIT_CMP,
unnamed_address::FN_ADDRESS_COMPARISONS,
unnamed_address::VTABLE_ADDRESS_COMPARISONS,
unnecessary_box_return::UNNECESSARY_BOX_RETURN,
unnecessary_box_returns::UNNECESSARY_BOX_RETURNS,
unnecessary_owned_empty_strings::UNNECESSARY_OWNED_EMPTY_STRINGS,
unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS,
unnecessary_sort_by::UNNECESSARY_SORT_BY,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/lib.register_nursery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS),
LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR),
LintId::of(unnecessary_box_return::UNNECESSARY_BOX_RETURN),
LintId::of(unnecessary_box_returns::UNNECESSARY_BOX_RETURNS),
LintId::of(unused_rounding::UNUSED_ROUNDING),
LintId::of(use_self::USE_SELF),
])
4 changes: 2 additions & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ mod unit_hash;
mod unit_return_expecting_ord;
mod unit_types;
mod unnamed_address;
mod unnecessary_box_return;
mod unnecessary_box_returns;
mod unnecessary_owned_empty_strings;
mod unnecessary_self_imports;
mod unnecessary_sort_by;
Expand Down Expand Up @@ -931,7 +931,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
store.register_late_pass(|| Box::new(invalid_utf8_in_unchecked::InvalidUtf8InUnchecked));
store.register_late_pass(|| Box::new(std_instead_of_core::StdReexports::default()));
store.register_late_pass(|| Box::new(std_instead_of_core::StdReexports));
store.register_late_pass(|| Box::new(unnecessary_box_return::UnnecessaryBoxReturn));
store.register_late_pass(|| Box::new(unnecessary_box_returns::UnnecessaryBoxReturns));
// add lints here, do not remove this comment, it's used in `new_lint`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ declare_clippy_lint! {
/// }
/// ```
#[clippy::version = "1.64.0"]
pub UNNECESSARY_BOX_RETURN,
pub UNNECESSARY_BOX_RETURNS,
nursery,
"Needlessly returning a Box"
}
declare_lint_pass!(UnnecessaryBoxReturn => [UNNECESSARY_BOX_RETURN]);
declare_lint_pass!(UnnecessaryBoxReturns => [UNNECESSARY_BOX_RETURNS]);

impl LateLintPass<'_> for UnnecessaryBoxReturn {
impl LateLintPass<'_> for UnnecessaryBoxReturns {
fn check_fn(
&mut self,
cx: &LateContext<'_>,
Expand Down Expand Up @@ -68,7 +68,7 @@ impl LateLintPass<'_> for UnnecessaryBoxReturn {
if implements_trait(cx, boxed_ty, sized_trait, &[]) {
span_lint_and_sugg(
cx,
UNNECESSARY_BOX_RETURN,
UNNECESSARY_BOX_RETURNS,
return_ty_hir.span,
format!("function returns `Box<{0}>` when `{0}` implements `Sized`", boxed_ty).as_str(),
"change the return type to",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![warn(clippy::unnecessary_box_return)]
#![warn(clippy::unnecessary_box_returns)]

struct Foo {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: function returns `Box<usize>` when `usize` implements `Sized`
--> $DIR/unnecessary_box_return.rs:6:21
--> $DIR/unnecessary_box_returns.rs:6:21
|
LL | fn boxed_usize() -> Box<usize> {
| ^^^^^^^^^^ help: change the return type to: `usize`
|
= note: `-D clippy::unnecessary-box-return` implied by `-D warnings`
= note: `-D clippy::unnecessary-box-returns` implied by `-D warnings`

error: function returns `Box<Foo>` when `Foo` implements `Sized`
--> $DIR/unnecessary_box_return.rs:11:19
--> $DIR/unnecessary_box_returns.rs:11:19
|
LL | fn boxed_foo() -> Box<Foo> {
| ^^^^^^^^ help: change the return type to: `Foo`
Expand Down

0 comments on commit 4a2a27d

Please sign in to comment.