mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
parent
c25f26d4ca
commit
d4409350dc
1 changed files with 8 additions and 2 deletions
|
@ -498,8 +498,14 @@ fn is_signum(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_float(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
|
fn is_float(cx: &LateContext<'_, '_>, expr: &Expr) -> bool {
|
||||||
matches!(walk_ptrs_ty(cx.tables.expr_ty(expr)).kind, ty::Float(_))
|
let value = &walk_ptrs_ty(cx.tables.expr_ty(expr)).sty;
|
||||||
|
|
||||||
|
if let ty::Array(arr_ty, _) = value {
|
||||||
|
return matches!(arr_ty.sty, ty::Float(_));
|
||||||
|
};
|
||||||
|
|
||||||
|
matches!(value, ty::Float(_))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_to_owned(cx: &LateContext<'_, '_>, expr: &Expr<'_>, other: &Expr<'_>) {
|
fn check_to_owned(cx: &LateContext<'_, '_>, expr: &Expr<'_>, other: &Expr<'_>) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue