Skip to content

Commit 9f41692

Browse files
committed
Make clippy happy.
1 parent cf43ea3 commit 9f41692

File tree

3 files changed

+18
-25
lines changed

3 files changed

+18
-25
lines changed

src/tools/clippy/clippy_utils/src/sym.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ generate! {
166166
from_ne_bytes,
167167
from_ptr,
168168
from_raw,
169-
from_str,
170169
from_str_radix,
171170
fs,
172171
fuse,

src/tools/clippy/tests/ui/author/macro_in_closure.stdout

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,16 @@ if let StmtKind::Let(local) = stmt.kind
3030
&& let PatKind::Binding(BindingMode::NONE, _, name1, None) = local2.pat.kind
3131
&& name1.as_str() == "args"
3232
&& let Some(trailing_expr) = block1.expr
33-
&& let ExprKind::Call(func2, args2) = trailing_expr.kind
34-
&& paths::CORE_FMT_RT_NEW_V1.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
33+
&& let ExprKind::Block(block2, None) = trailing_expr.kind
34+
&& block2.stmts.is_empty()
35+
&& let Some(trailing_expr1) = block2.expr
36+
&& let ExprKind::Call(func2, args2) = trailing_expr1.kind
37+
&& paths::CORE_FMT_RT_NEW.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
3538
&& args2.len() == 2
36-
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[0].kind
37-
&& let ExprKind::Array(elements2) = inner1.kind
38-
&& elements2.len() == 2
39-
&& let ExprKind::Lit(ref lit) = elements2[0].kind
40-
&& let LitKind::Str(s, _) = lit.node
41-
&& s.as_str() == ""
42-
&& let ExprKind::Lit(ref lit1) = elements2[1].kind
43-
&& let LitKind::Str(s1, _) = lit1.node
44-
&& s1.as_str() == "\n"
45-
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner2) = args2[1].kind
39+
&& let ExprKind::Lit(ref lit) = args2[0].kind
40+
&& let LitKind::ByteStr(ref vec) = lit.node
41+
&& let [[128, 1, 10, 0]] = **vec
42+
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[1].kind
4643
&& block.expr.is_none()
4744
&& let PatKind::Binding(BindingMode::NONE, _, name2, None) = local.pat.kind
4845
&& name2.as_str() == "print_text"

src/tools/clippy/tests/ui/author/macro_in_loop.stdout

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,16 @@ if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, .. }) = higher::Fo
4141
&& let PatKind::Binding(BindingMode::NONE, _, name2, None) = local1.pat.kind
4242
&& name2.as_str() == "args"
4343
&& let Some(trailing_expr) = block2.expr
44-
&& let ExprKind::Call(func2, args2) = trailing_expr.kind
45-
&& paths::CORE_FMT_RT_NEW_V1.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
44+
&& let ExprKind::Block(block3, None) = trailing_expr.kind
45+
&& block3.stmts.is_empty()
46+
&& let Some(trailing_expr1) = block3.expr
47+
&& let ExprKind::Call(func2, args2) = trailing_expr1.kind
48+
&& paths::CORE_FMT_RT_NEW.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
4649
&& args2.len() == 2
47-
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[0].kind
48-
&& let ExprKind::Array(elements2) = inner1.kind
49-
&& elements2.len() == 2
50-
&& let ExprKind::Lit(ref lit2) = elements2[0].kind
51-
&& let LitKind::Str(s, _) = lit2.node
52-
&& s.as_str() == ""
53-
&& let ExprKind::Lit(ref lit3) = elements2[1].kind
54-
&& let LitKind::Str(s1, _) = lit3.node
55-
&& s1.as_str() == "\n"
56-
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner2) = args2[1].kind
50+
&& let ExprKind::Lit(ref lit2) = args2[0].kind
51+
&& let LitKind::ByteStr(ref vec) = lit2.node
52+
&& let [[128, 1, 10, 0]] = **vec
53+
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[1].kind
5754
&& block1.expr.is_none()
5855
&& block.expr.is_none()
5956
{

0 commit comments

Comments
 (0)