Skip to content

Commit 9ce826a

Browse files
authored
Merge pull request #3082 from mikerite/move-range-lints
Move some range lints to complexity
2 parents ff5f07b + cc87dc7 commit 9ce826a

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
@@ -634,6 +634,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
634634
question_mark::QUESTION_MARK,
635635
ranges::ITERATOR_STEP_BY_ZERO,
636636
ranges::RANGE_MINUS_ONE,
637+
ranges::RANGE_PLUS_ONE,
637638
ranges::RANGE_ZIP_WITH_LEN,
638639
redundant_field_names::REDUNDANT_FIELD_NAMES,
639640
reference::DEREF_ADDROF,
@@ -755,7 +756,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
755756
ptr::CMP_NULL,
756757
ptr::PTR_ARG,
757758
question_mark::QUESTION_MARK,
758-
ranges::RANGE_MINUS_ONE,
759759
redundant_field_names::REDUNDANT_FIELD_NAMES,
760760
regex::REGEX_MACRO,
761761
regex::TRIVIAL_REGEX,
@@ -815,6 +815,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
815815
overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
816816
partialeq_ne_impl::PARTIALEQ_NE_IMPL,
817817
precedence::PRECEDENCE,
818+
ranges::RANGE_MINUS_ONE,
819+
ranges::RANGE_PLUS_ONE,
818820
ranges::RANGE_ZIP_WITH_LEN,
819821
reference::DEREF_ADDROF,
820822
reference::REF_IN_DEREF,
@@ -920,7 +922,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
920922
fallible_impl_from::FALLIBLE_IMPL_FROM,
921923
mutex_atomic::MUTEX_INTEGER,
922924
needless_borrow::NEEDLESS_BORROW,
923-
ranges::RANGE_PLUS_ONE,
924925
unwrap::PANICKING_UNWRAP,
925926
unwrap::UNNECESSARY_UNWRAP,
926927
]);

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)