Skip to content

Commit b608ec8

Browse files
tabokieflip1995
authored andcommitted
move [assertions_on_result_states] to restriction
Signed-off-by: tabokie <xy.tao@outlook.com>
1 parent 9538d2d commit b608ec8

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/tools/clippy/clippy_lints/src/assertions_on_result_states.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ declare_clippy_lint! {
1919
/// ### Why is this bad?
2020
/// An assertion failure cannot output an useful message of the error.
2121
///
22+
/// ### Known problems
23+
/// The suggested replacement decreases the readability of code and log output.
24+
///
2225
/// ### Example
2326
/// ```rust,ignore
2427
/// # let r = Ok::<_, ()>(());
@@ -28,7 +31,7 @@ declare_clippy_lint! {
2831
/// ```
2932
#[clippy::version = "1.64.0"]
3033
pub ASSERTIONS_ON_RESULT_STATES,
31-
style,
34+
restriction,
3235
"`assert!(r.is_ok())`/`assert!(r.is_err())` gives worse error message than directly calling `r.unwrap()`/`r.unwrap_err()`"
3336
}
3437

src/tools/clippy/clippy_lints/src/lib.register_all.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
66
LintId::of(almost_complete_letter_range::ALMOST_COMPLETE_LETTER_RANGE),
77
LintId::of(approx_const::APPROX_CONSTANT),
88
LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
9-
LintId::of(assertions_on_result_states::ASSERTIONS_ON_RESULT_STATES),
109
LintId::of(async_yields_async::ASYNC_YIELDS_ASYNC),
1110
LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
1211
LintId::of(attrs::DEPRECATED_CFG_ATTR),

src/tools/clippy/clippy_lints/src/lib.register_restriction.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), ve
77
LintId::of(as_underscore::AS_UNDERSCORE),
88
LintId::of(asm_syntax::INLINE_ASM_X86_ATT_SYNTAX),
99
LintId::of(asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX),
10+
LintId::of(assertions_on_result_states::ASSERTIONS_ON_RESULT_STATES),
1011
LintId::of(attrs::ALLOW_ATTRIBUTES_WITHOUT_REASON),
1112
LintId::of(casts::FN_TO_NUMERIC_CAST_ANY),
1213
LintId::of(create_dir::CREATE_DIR),

src/tools/clippy/clippy_lints/src/lib.register_style.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
store.register_group(true, "clippy::style", Some("clippy_style"), vec![
66
LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
7-
LintId::of(assertions_on_result_states::ASSERTIONS_ON_RESULT_STATES),
87
LintId::of(blacklisted_name::BLACKLISTED_NAME),
98
LintId::of(blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
109
LintId::of(bool_assert_comparison::BOOL_ASSERT_COMPARISON),

0 commit comments

Comments
 (0)