less false positives for approx_const and float_cmp

This commit is contained in:
llogiq 2015-09-11 15:30:08 +02:00
parent aefad45ee7
commit 681bce925f
2 changed files with 10 additions and 2 deletions

View file

@ -93,7 +93,7 @@ impl LintPass for FloatCmp {
return;
}
if let Some(name) = get_item_name(cx, expr) {
if name == "eq" || name == "ne" ||
if name == "eq" || name == "ne" || name == "is_nan" ||
name.as_str().starts_with("eq_") ||
name.as_str().ends_with("_eq") {
return;