Skip to content

Commit 1e448f8

Browse files
committed
Clippy
1 parent a492d9d commit 1e448f8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

crates/ide-diagnostics/src/handlers/remove_unnecessary_else.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn test() {
179179

180180
#[test]
181181
fn remove_unnecessary_else_for_return3() {
182-
check_diagnostics_with_needless_return_disabled(
182+
check_diagnostics_with_disabled(
183183
r#"
184184
fn test(a: bool) -> i32 {
185185
if a {
@@ -190,6 +190,7 @@ fn test(a: bool) -> i32 {
190190
}
191191
}
192192
"#,
193+
&["needless_return", "E0425"],
193194
);
194195
check_fix(
195196
r#"
@@ -473,7 +474,7 @@ fn test() {
473474

474475
#[test]
475476
fn no_diagnostic_if_not_expr_stmt() {
476-
check_diagnostics_with_needless_return_disabled(
477+
check_diagnostics_with_disabled(
477478
r#"
478479
fn test1() {
479480
let _x = if a {
@@ -495,13 +496,15 @@ fn test2() {
495496
};
496497
}
497498
"#,
499+
&["needless_return", "E0425"],
498500
);
499-
check_diagnostics(
501+
check_diagnostics_with_disabled(
500502
r#"
501503
fn test3() -> u8 {
502504
foo(if a { return 1 } else { 0 })
503505
}
504506
"#,
507+
&["E0425"],
505508
);
506509
}
507510
}

crates/ide-diagnostics/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub(crate) fn check_diagnostics(ra_fixture: &str) {
200200
#[track_caller]
201201
pub(crate) fn check_diagnostics_with_disabled(ra_fixture: &str, disabled: &[&str]) {
202202
let mut config = DiagnosticsConfig::test_sample();
203-
config.disabled.extend(disabled.into_iter().map(|&s| s.to_owned()));
203+
config.disabled.extend(disabled.iter().map(|&s| s.to_owned()));
204204
check_diagnostics_with_config(config, ra_fixture)
205205
}
206206

0 commit comments

Comments
 (0)