Skip to content

Commit d54cb12

Browse files
committed
Rename ok_if_let to if_let_some_result
1 parent d8ac4b0 commit d54cb12

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

clippy_lints/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ pub mod functions;
209209
pub mod get_last_with_len;
210210
pub mod identity_conversion;
211211
pub mod identity_op;
212+
pub mod if_let_some_result;
212213
pub mod if_not_else;
213214
pub mod implicit_return;
214215
pub mod indexing_slicing;
@@ -262,7 +263,6 @@ pub mod new_without_default;
262263
pub mod no_effect;
263264
pub mod non_copy_const;
264265
pub mod non_expressive_names;
265-
pub mod ok_if_let;
266266
pub mod open_options;
267267
pub mod overflow_check_conditional;
268268
pub mod panic_unimplemented;
@@ -701,7 +701,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
701701
&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
702702
&non_expressive_names::MANY_SINGLE_CHAR_NAMES,
703703
&non_expressive_names::SIMILAR_NAMES,
704-
&ok_if_let::IF_LET_SOME_RESULT,
704+
&if_let_some_result::IF_LET_SOME_RESULT,
705705
&open_options::NONSENSICAL_OPEN_OPTIONS,
706706
&overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
707707
&panic_unimplemented::PANIC,
@@ -902,7 +902,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
902902
store.register_late_pass(|| box eval_order_dependence::EvalOrderDependence);
903903
store.register_late_pass(|| box missing_doc::MissingDoc::new());
904904
store.register_late_pass(|| box missing_inline::MissingInline);
905-
store.register_late_pass(|| box ok_if_let::OkIfLet);
905+
store.register_late_pass(|| box if_let_some_result::OkIfLet);
906906
store.register_late_pass(|| box redundant_pattern_matching::RedundantPatternMatching);
907907
store.register_late_pass(|| box partialeq_ne_impl::PartialEqNeImpl);
908908
store.register_late_pass(|| box unused_io_amount::UnusedIoAmount);
@@ -1260,7 +1260,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
12601260
LintId::of(&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
12611261
LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
12621262
LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES),
1263-
LintId::of(&ok_if_let::IF_LET_SOME_RESULT),
1263+
LintId::of(&if_let_some_result::IF_LET_SOME_RESULT),
12641264
LintId::of(&open_options::NONSENSICAL_OPEN_OPTIONS),
12651265
LintId::of(&overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),
12661266
LintId::of(&panic_unimplemented::PANIC_PARAMS),
@@ -1409,7 +1409,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
14091409
LintId::of(&new_without_default::NEW_WITHOUT_DEFAULT),
14101410
LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
14111411
LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES),
1412-
LintId::of(&ok_if_let::IF_LET_SOME_RESULT),
1412+
LintId::of(&if_let_some_result::IF_LET_SOME_RESULT),
14131413
LintId::of(&panic_unimplemented::PANIC_PARAMS),
14141414
LintId::of(&ptr::CMP_NULL),
14151415
LintId::of(&ptr::PTR_ARG),

src/lintlist/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ pub const ALL_LINTS: [Lint; 346] = [
698698
group: "style",
699699
desc: "usage of `ok()` in `if let Some(pat)` statements is unnecessary, match on `Ok(pat)` instead",
700700
deprecation: None,
701-
module: "ok_if_let",
701+
module: "if_let_some_result",
702702
},
703703
Lint {
704704
name: "if_not_else",
File renamed without changes.
File renamed without changes.

tests/ui/ok_if_let.stderr renamed to tests/ui/if_let_some_result.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: Matching on `Some` with `ok()` is redundant
2-
--> $DIR/ok_if_let.rs:6:5
2+
--> $DIR/if_let_some_result.rs:6:5
33
|
44
LL | / if let Some(y) = x.parse().ok() {
55
LL | | y
@@ -19,7 +19,7 @@ LL | }
1919
|
2020

2121
error: Matching on `Some` with `ok()` is redundant
22-
--> $DIR/ok_if_let.rs:23:9
22+
--> $DIR/if_let_some_result.rs:23:9
2323
|
2424
LL | / if let Some(y) = x.parse().ok() {
2525
LL | | return y;

0 commit comments

Comments
 (0)