Skip to content

Commit cc87dc7

Browse files
author
Michael Wright
committed
Move some range lints to complexity
Recategorize `range_plus_one` and `range_minus_one` to `complexity`. This moves `range_plus_one` out of the nursery as the inclusive range syntax is now stable. Both are moved to `complexity` as it is more consistent with other lints such as `int_plus_one`.
1 parent 296b79b commit cc87dc7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

clippy_lints/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
635635
question_mark::QUESTION_MARK,
636636
ranges::ITERATOR_STEP_BY_ZERO,
637637
ranges::RANGE_MINUS_ONE,
638+
ranges::RANGE_PLUS_ONE,
638639
ranges::RANGE_ZIP_WITH_LEN,
639640
redundant_field_names::REDUNDANT_FIELD_NAMES,
640641
reference::DEREF_ADDROF,
@@ -756,7 +757,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
756757
ptr::CMP_NULL,
757758
ptr::PTR_ARG,
758759
question_mark::QUESTION_MARK,
759-
ranges::RANGE_MINUS_ONE,
760760
redundant_field_names::REDUNDANT_FIELD_NAMES,
761761
regex::REGEX_MACRO,
762762
regex::TRIVIAL_REGEX,
@@ -816,6 +816,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
816816
overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
817817
partialeq_ne_impl::PARTIALEQ_NE_IMPL,
818818
precedence::PRECEDENCE,
819+
ranges::RANGE_MINUS_ONE,
820+
ranges::RANGE_PLUS_ONE,
819821
ranges::RANGE_ZIP_WITH_LEN,
820822
reference::DEREF_ADDROF,
821823
reference::REF_IN_DEREF,
@@ -921,7 +923,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
921923
fallible_impl_from::FALLIBLE_IMPL_FROM,
922924
mutex_atomic::MUTEX_INTEGER,
923925
needless_borrow::NEEDLESS_BORROW,
924-
ranges::RANGE_PLUS_ONE,
925926
unwrap::PANICKING_UNWRAP,
926927
unwrap::UNNECESSARY_UNWRAP,
927928
]);

clippy_lints/src/ranges.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ declare_clippy_lint! {
5757
/// ```
5858
declare_clippy_lint! {
5959
pub RANGE_PLUS_ONE,
60-
nursery,
60+
complexity,
6161
"`x..(y+1)` reads better as `x..=y`"
6262
}
6363

@@ -75,7 +75,7 @@ declare_clippy_lint! {
7575
/// ```
7676
declare_clippy_lint! {
7777
pub RANGE_MINUS_ONE,
78-
style,
78+
complexity,
7979
"`x..=(y-1)` reads better as `x..y`"
8080
}
8181

0 commit comments

Comments
 (0)