From ae872fe1c74d68d7d1e88079cc77c858268fcdbf Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 11 Jan 2020 03:29:55 +0900 Subject: [PATCH] Rename `ok_if_let` to `if_let_some_result` --- .../src/{ok_if_let.rs => if_let_some_result.rs} | 0 clippy_lints/src/lib.rs | 10 +++++----- src/lintlist/mod.rs | 2 +- tests/ui/{ok_if_let.fixed => if_let_some_result.fixed} | 0 tests/ui/{ok_if_let.rs => if_let_some_result.rs} | 0 .../ui/{ok_if_let.stderr => if_let_some_result.stderr} | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) rename clippy_lints/src/{ok_if_let.rs => if_let_some_result.rs} (100%) rename tests/ui/{ok_if_let.fixed => if_let_some_result.fixed} (100%) rename tests/ui/{ok_if_let.rs => if_let_some_result.rs} (100%) rename tests/ui/{ok_if_let.stderr => if_let_some_result.stderr} (91%) diff --git a/clippy_lints/src/ok_if_let.rs b/clippy_lints/src/if_let_some_result.rs similarity index 100% rename from clippy_lints/src/ok_if_let.rs rename to clippy_lints/src/if_let_some_result.rs diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 5fe0d937f2f..8a90e39f2e9 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -210,6 +210,7 @@ pub mod functions; pub mod get_last_with_len; pub mod identity_conversion; pub mod identity_op; +pub mod if_let_some_result; pub mod if_not_else; pub mod implicit_return; pub mod indexing_slicing; @@ -263,7 +264,6 @@ pub mod new_without_default; pub mod no_effect; pub mod non_copy_const; pub mod non_expressive_names; -pub mod ok_if_let; pub mod open_options; pub mod overflow_check_conditional; pub mod panic_unimplemented; @@ -703,7 +703,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: &non_expressive_names::JUST_UNDERSCORES_AND_DIGITS, &non_expressive_names::MANY_SINGLE_CHAR_NAMES, &non_expressive_names::SIMILAR_NAMES, - &ok_if_let::IF_LET_SOME_RESULT, + &if_let_some_result::IF_LET_SOME_RESULT, &open_options::NONSENSICAL_OPEN_OPTIONS, &overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL, &panic_unimplemented::PANIC, @@ -904,7 +904,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: store.register_late_pass(|| box eval_order_dependence::EvalOrderDependence); store.register_late_pass(|| box missing_doc::MissingDoc::new()); store.register_late_pass(|| box missing_inline::MissingInline); - store.register_late_pass(|| box ok_if_let::OkIfLet); + store.register_late_pass(|| box if_let_some_result::OkIfLet); store.register_late_pass(|| box redundant_pattern_matching::RedundantPatternMatching); store.register_late_pass(|| box partialeq_ne_impl::PartialEqNeImpl); store.register_late_pass(|| box unused_io_amount::UnusedIoAmount); @@ -1265,7 +1265,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST), LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS), LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES), - LintId::of(&ok_if_let::IF_LET_SOME_RESULT), + LintId::of(&if_let_some_result::IF_LET_SOME_RESULT), LintId::of(&open_options::NONSENSICAL_OPEN_OPTIONS), LintId::of(&overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL), LintId::of(&panic_unimplemented::PANIC_PARAMS), @@ -1413,7 +1413,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&new_without_default::NEW_WITHOUT_DEFAULT), LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS), LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES), - LintId::of(&ok_if_let::IF_LET_SOME_RESULT), + LintId::of(&if_let_some_result::IF_LET_SOME_RESULT), LintId::of(&panic_unimplemented::PANIC_PARAMS), LintId::of(&ptr::CMP_NULL), LintId::of(&ptr::PTR_ARG), diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs index eee16fcd312..c6339daf2eb 100644 --- a/src/lintlist/mod.rs +++ b/src/lintlist/mod.rs @@ -705,7 +705,7 @@ pub const ALL_LINTS: [Lint; 347] = [ group: "style", desc: "usage of `ok()` in `if let Some(pat)` statements is unnecessary, match on `Ok(pat)` instead", deprecation: None, - module: "ok_if_let", + module: "if_let_some_result", }, Lint { name: "if_not_else", diff --git a/tests/ui/ok_if_let.fixed b/tests/ui/if_let_some_result.fixed similarity index 100% rename from tests/ui/ok_if_let.fixed rename to tests/ui/if_let_some_result.fixed diff --git a/tests/ui/ok_if_let.rs b/tests/ui/if_let_some_result.rs similarity index 100% rename from tests/ui/ok_if_let.rs rename to tests/ui/if_let_some_result.rs diff --git a/tests/ui/ok_if_let.stderr b/tests/ui/if_let_some_result.stderr similarity index 91% rename from tests/ui/ok_if_let.stderr rename to tests/ui/if_let_some_result.stderr index 4aa6057ba47..6925dfa0bf9 100644 --- a/tests/ui/ok_if_let.stderr +++ b/tests/ui/if_let_some_result.stderr @@ -1,5 +1,5 @@ error: Matching on `Some` with `ok()` is redundant - --> $DIR/ok_if_let.rs:6:5 + --> $DIR/if_let_some_result.rs:6:5 | LL | / if let Some(y) = x.parse().ok() { LL | | y @@ -19,7 +19,7 @@ LL | } | error: Matching on `Some` with `ok()` is redundant - --> $DIR/ok_if_let.rs:23:9 + --> $DIR/if_let_some_result.rs:23:9 | LL | / if let Some(y) = x.parse().ok() { LL | | return y;