Skip to content

Commit 37b3aaa

Browse files
committed
Resolve wildcard_imports pedantic clippy lint
error: usage of wildcard import --> tests/test_size.rs:5:5 | 5 | use syn::*; | ^^^^^^ help: try: `syn::{Expr, Item, Lit, Pat, Type}` | = note: `-D clippy::wildcard-imports` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports error: usage of wildcard import --> tests/test_precedence.rs:350:9 | 350 | use syn::fold::*; | ^^^^^^^^^^^^ help: try: `syn::fold::{Fold, fold_expr, fold_generic_argument, fold_generic_method_argument}` | = note: `-D clippy::wildcard-imports` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports error: usage of wildcard import --> tests/test_precedence.rs:351:9 | 351 | use syn::*; | ^^^^^^ help: try: `syn::{Expr, ExprParen, GenericArgument, GenericMethodArgument, Pat, Stmt, Type, token}` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports error: usage of wildcard import --> tests/test_precedence.rs:427:9 | 427 | use syn::fold::*; | ^^^^^^^^^^^^ help: try: `syn::fold::Fold` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports error: usage of wildcard import --> tests/test_precedence.rs:429:9 | 429 | use syn::*; | ^^^^^^ help: try: `syn::{Expr, ExprTuple, token}` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
1 parent 4366423 commit 37b3aaa

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tests/test_precedence.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
clippy::explicit_deref_methods,
66
clippy::if_then_panic,
77
clippy::match_wildcard_for_single_variants,
8-
clippy::too_many_lines,
9-
clippy::wildcard_imports
8+
clippy::too_many_lines
109
)]
1110

1211
//! The tests in this module do the following:
@@ -347,8 +346,8 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> {
347346
/// reveal the precedence of the parsed expressions, and produce a stringified
348347
/// form of the resulting expression.
349348
fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr {
350-
use syn::fold::*;
351-
use syn::*;
349+
use syn::fold::{fold_expr, fold_generic_argument, fold_generic_method_argument, Fold};
350+
use syn::{token, Expr, ExprParen, GenericArgument, GenericMethodArgument, Pat, Stmt, Type};
352351

353352
struct ParenthesizeEveryExpr;
354353
impl Fold for ParenthesizeEveryExpr {
@@ -424,9 +423,9 @@ fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr {
424423

425424
/// Walk through a crate collecting all expressions we can find in it.
426425
fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
427-
use syn::fold::*;
426+
use syn::fold::Fold;
428427
use syn::punctuated::Punctuated;
429-
use syn::*;
428+
use syn::{token, Expr, ExprTuple};
430429

431430
struct CollectExprs(Vec<Expr>);
432431
impl Fold for CollectExprs {

tests/test_size.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#![cfg(target_pointer_width = "64")]
2-
#![allow(clippy::wildcard_imports)]
32

43
use std::mem;
5-
use syn::*;
4+
use syn::{Expr, Item, Lit, Pat, Type};
65

76
#[test]
87
fn test_expr_size() {

0 commit comments

Comments
 (0)