Skip to content

Commit a59d480

Browse files
committed
Remove can_suggest check for is_ok and is_err.
`is_ok` and `is_err` are stabilized as const and can thus always be suggested.
1 parent ab4fa21 commit a59d480

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tools/clippy/clippy_lints/src/matches.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1469,10 +1469,10 @@ mod redundant_pattern_match {
14691469
keyword: &'static str,
14701470
) {
14711471
fn find_suggestion(cx: &LateContext<'_>, hir_id: HirId, path: &QPath<'_>) -> Option<&'static str> {
1472-
if match_qpath(path, &paths::RESULT_OK) && can_suggest(cx, hir_id, sym!(result_type), "is_ok") {
1472+
if match_qpath(path, &paths::RESULT_OK) {
14731473
return Some("is_ok()");
14741474
}
1475-
if match_qpath(path, &paths::RESULT_ERR) && can_suggest(cx, hir_id, sym!(result_type), "is_err") {
1475+
if match_qpath(path, &paths::RESULT_ERR) {
14761476
return Some("is_err()");
14771477
}
14781478
if match_qpath(path, &paths::OPTION_SOME) && can_suggest(cx, hir_id, sym!(option_type), "is_some") {
@@ -1562,8 +1562,8 @@ mod redundant_pattern_match {
15621562
&paths::RESULT_ERR,
15631563
"is_ok()",
15641564
"is_err()",
1565-
|| can_suggest(cx, hir_id, sym!(result_type), "is_ok"),
1566-
|| can_suggest(cx, hir_id, sym!(result_type), "is_err"),
1565+
|| true,
1566+
|| true
15671567
)
15681568
} else {
15691569
None

0 commit comments

Comments
 (0)