Make clippy happy.

This commit is contained in:
Mara Bos 2025-11-10 15:11:28 +01:00
parent 70cfebbddc
commit 18de21629a
3 changed files with 18 additions and 25 deletions

View file

@ -166,7 +166,6 @@ generate! {
from_ne_bytes,
from_ptr,
from_raw,
from_str,
from_str_radix,
fs,
fuse,

View file

@ -30,19 +30,16 @@ if let StmtKind::Let(local) = stmt.kind
&& let PatKind::Binding(BindingMode::NONE, _, name1, None) = local2.pat.kind
&& name1.as_str() == "args"
&& let Some(trailing_expr) = block1.expr
&& let ExprKind::Call(func2, args2) = trailing_expr.kind
&& paths::CORE_FMT_RT_NEW_V1.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
&& let ExprKind::Block(block2, None) = trailing_expr.kind
&& block2.stmts.is_empty()
&& let Some(trailing_expr1) = block2.expr
&& let ExprKind::Call(func2, args2) = trailing_expr1.kind
&& paths::CORE_FMT_RT_NEW.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
&& args2.len() == 2
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[0].kind
&& let ExprKind::Array(elements2) = inner1.kind
&& elements2.len() == 2
&& let ExprKind::Lit(ref lit) = elements2[0].kind
&& let LitKind::Str(s, _) = lit.node
&& s.as_str() == ""
&& let ExprKind::Lit(ref lit1) = elements2[1].kind
&& let LitKind::Str(s1, _) = lit1.node
&& s1.as_str() == "\n"
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner2) = args2[1].kind
&& let ExprKind::Lit(ref lit) = args2[0].kind
&& let LitKind::ByteStr(ref vec) = lit.node
&& let [[128, 1, 10, 0]] = **vec
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[1].kind
&& block.expr.is_none()
&& let PatKind::Binding(BindingMode::NONE, _, name2, None) = local.pat.kind
&& name2.as_str() == "print_text"

View file

@ -41,19 +41,16 @@ if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, .. }) = higher::Fo
&& let PatKind::Binding(BindingMode::NONE, _, name2, None) = local1.pat.kind
&& name2.as_str() == "args"
&& let Some(trailing_expr) = block2.expr
&& let ExprKind::Call(func2, args2) = trailing_expr.kind
&& paths::CORE_FMT_RT_NEW_V1.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
&& let ExprKind::Block(block3, None) = trailing_expr.kind
&& block3.stmts.is_empty()
&& let Some(trailing_expr1) = block3.expr
&& let ExprKind::Call(func2, args2) = trailing_expr1.kind
&& paths::CORE_FMT_RT_NEW.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
&& args2.len() == 2
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[0].kind
&& let ExprKind::Array(elements2) = inner1.kind
&& elements2.len() == 2
&& let ExprKind::Lit(ref lit2) = elements2[0].kind
&& let LitKind::Str(s, _) = lit2.node
&& s.as_str() == ""
&& let ExprKind::Lit(ref lit3) = elements2[1].kind
&& let LitKind::Str(s1, _) = lit3.node
&& s1.as_str() == "\n"
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner2) = args2[1].kind
&& let ExprKind::Lit(ref lit2) = args2[0].kind
&& let LitKind::ByteStr(ref vec) = lit2.node
&& let [[128, 1, 10, 0]] = **vec
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[1].kind
&& block1.expr.is_none()
&& block.expr.is_none()
{