Skip to content

Commit 640e118

Browse files
committed
chore(needless_if): rename to needless_ifs
1 parent a0a347e commit 640e118

File tree

88 files changed

+204
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+204
-191
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[
544544
crate::needless_continue::NEEDLESS_CONTINUE_INFO,
545545
crate::needless_else::NEEDLESS_ELSE_INFO,
546546
crate::needless_for_each::NEEDLESS_FOR_EACH_INFO,
547-
crate::needless_if::NEEDLESS_IF_INFO,
547+
crate::needless_ifs::NEEDLESS_IFS_INFO,
548548
crate::needless_late_init::NEEDLESS_LATE_INIT_INFO,
549549
crate::needless_maybe_sized::NEEDLESS_MAYBE_SIZED_INFO,
550550
crate::needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS_INFO,

clippy_lints/src/deprecated_lints.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ declare_with_version! { RENAMED(RENAMED_VERSION) = [
139139
("clippy::mem_discriminant_non_enum", "enum_intrinsics_non_enums"),
140140
#[clippy::version = "1.80.0"]
141141
("clippy::mismatched_target_os", "unexpected_cfgs"),
142+
#[clippy::version = "1.92.0"]
143+
("clippy::needless_if", "clippy::needless_ifs"),
142144
#[clippy::version = ""]
143145
("clippy::new_without_default_derive", "clippy::new_without_default"),
144146
#[clippy::version = ""]

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ mod needless_borrows_for_generic_args;
253253
mod needless_continue;
254254
mod needless_else;
255255
mod needless_for_each;
256-
mod needless_if;
256+
mod needless_ifs;
257257
mod needless_late_init;
258258
mod needless_maybe_sized;
259259
mod needless_parens_on_range_literals;
@@ -752,7 +752,7 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co
752752
store.register_late_pass(|_| Box::new(endian_bytes::EndianBytes));
753753
store.register_late_pass(|_| Box::new(redundant_type_annotations::RedundantTypeAnnotations));
754754
store.register_late_pass(|_| Box::new(arc_with_non_send_sync::ArcWithNonSendSync));
755-
store.register_late_pass(|_| Box::new(needless_if::NeedlessIf));
755+
store.register_late_pass(|_| Box::new(needless_ifs::NeedlessIfs));
756756
store.register_late_pass(move |_| Box::new(min_ident_chars::MinIdentChars::new(conf)));
757757
store.register_late_pass(move |_| Box::new(large_stack_frames::LargeStackFrames::new(conf)));
758758
store.register_late_pass(|_| Box::new(single_range_in_vec_init::SingleRangeInVecInit));

clippy_lints/src/needless_if.rs renamed to clippy_lints/src/needless_ifs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ declare_clippy_lint! {
2929
/// really_expensive_condition_with_side_effects(&mut i);
3030
/// ```
3131
#[clippy::version = "1.72.0"]
32-
pub NEEDLESS_IF,
32+
pub NEEDLESS_IFS,
3333
complexity,
3434
"checks for empty if branches"
3535
}
36-
declare_lint_pass!(NeedlessIf => [NEEDLESS_IF]);
36+
declare_lint_pass!(NeedlessIfs => [NEEDLESS_IFS]);
3737

38-
impl LateLintPass<'_> for NeedlessIf {
38+
impl LateLintPass<'_> for NeedlessIfs {
3939
fn check_stmt<'tcx>(&mut self, cx: &LateContext<'tcx>, stmt: &Stmt<'tcx>) {
4040
if let StmtKind::Expr(expr) = stmt.kind
4141
&& let Some(If {
@@ -62,7 +62,7 @@ impl LateLintPass<'_> for NeedlessIf {
6262
{
6363
span_lint_and_sugg(
6464
cx,
65-
NEEDLESS_IF,
65+
NEEDLESS_IFS,
6666
stmt.span,
6767
"this `if` branch is empty",
6868
"you can remove it",

tests/ui-toml/excessive_nesting/excessive_nesting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
clippy::no_effect,
1010
clippy::unnecessary_operation,
1111
clippy::never_loop,
12-
clippy::needless_if,
12+
clippy::needless_ifs,
1313
clippy::collapsible_if,
1414
clippy::blocks_in_conditions,
1515
clippy::single_match,

tests/ui/auxiliary/proc_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(proc_macro_span)]
2-
#![allow(clippy::needless_if, dead_code)]
2+
#![allow(clippy::needless_ifs, dead_code)]
33

44
extern crate proc_macro;
55

tests/ui/blocks_in_conditions.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![allow(
55
unused,
66
unnecessary_transmutes,
7-
clippy::needless_if,
7+
clippy::needless_ifs,
88
clippy::missing_transmute_annotations
99
)]
1010
#![warn(clippy::nonminimal_bool)]

tests/ui/blocks_in_conditions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![allow(
55
unused,
66
unnecessary_transmutes,
7-
clippy::needless_if,
7+
clippy::needless_ifs,
88
clippy::missing_transmute_annotations
99
)]
1010
#![warn(clippy::nonminimal_bool)]

tests/ui/bool_comparison.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(non_local_definitions, clippy::needless_if)]
1+
#![allow(non_local_definitions, clippy::needless_ifs)]
22
#![warn(clippy::bool_comparison)]
33
#![allow(clippy::non_canonical_partial_ord_impl)]
44

0 commit comments

Comments
 (0)