update a func

This commit is contained in:
disco07 2023-05-07 08:12:36 +02:00
parent 450a22f2dc
commit fb6bf1ebf6

View File

@ -289,23 +289,7 @@ fn found_good_method<'a>(
None
}
},
(PatKind::Path(ref path_left), PatKind::Wild) => {
if let Some(name) = get_ident(path_left) {
match name.as_str() {
"None" => find_good_method_for_matches_macro(
cx,
arms,
path_left,
Item::Lang(OptionNone),
"is_none()",
"is_some()",
),
_ => None,
}
} else {
None
}
},
(PatKind::Path(ref path_left), PatKind::Wild) => get_good_method(cx, arms, path_left),
_ => None,
}
}
@ -334,6 +318,14 @@ fn get_good_method<'a>(cx: &LateContext<'_>, arms: &[Arm<'_>], path_left: &QPath
"is_some()",
"is_none()",
),
"None" => find_good_method_for_matches_macro(
cx,
arms,
path_left,
Item::Lang(OptionNone),
"is_none()",
"is_some()",
),
_ => None,
};
}