Skip to content

Commit

Permalink
Apply clippy::unused_trait_names lint
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 13, 2025
1 parent d41535a commit 1be1b0c
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 28 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ inline_asm_x86_att_syntax = "warn"
trailing_empty_array = "warn"
transmute_undefined_repr = "warn"
undocumented_unsafe_blocks = "warn"
unused_trait_names = "warn"
# Suppress buggy or noisy clippy lints
bool_assert_comparison = { level = "allow", priority = 1 }
borrow_as_ptr = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/8286
Expand Down
4 changes: 3 additions & 1 deletion src/auto_enum/context.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use std::{cell::RefCell, collections::hash_map::DefaultHasher, hash::Hasher, iter, mem, thread};
use std::{
cell::RefCell, collections::hash_map::DefaultHasher, hash::Hasher as _, iter, mem, thread,
};

use proc_macro2::TokenStream;
use quote::format_ident;
Expand Down
2 changes: 1 addition & 1 deletion src/auto_enum/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use syn::{
};

use super::{visitor, Context, NAME, NESTED, NEVER};
use crate::utils::{expr_block, path_eq, replace_block, replace_expr, Attrs};
use crate::utils::{expr_block, path_eq, replace_block, replace_expr, Attrs as _};

/// Visits last expression.
///
Expand Down
2 changes: 1 addition & 1 deletion src/auto_enum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod type_analysis;
mod visitor;

use proc_macro2::TokenStream;
use quote::ToTokens;
use quote::ToTokens as _;
#[cfg(feature = "type_analysis")]
use syn::Pat;
use syn::{
Expand Down
2 changes: 1 addition & 1 deletion src/auto_enum/type_analysis.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use quote::ToTokens;
use quote::ToTokens as _;
use syn::{
visit_mut::{self, VisitMut},
Path, Type, TypeImplTrait, TypeParamBound,
Expand Down
2 changes: 1 addition & 1 deletion src/auto_enum/visitor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::TokenStream;
use quote::ToTokens;
use quote::ToTokens as _;
use syn::{
parse_quote, token,
visit_mut::{self, VisitMut},
Expand Down
2 changes: 1 addition & 1 deletion src/derive/core/future.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down
2 changes: 1 addition & 1 deletion src/derive/core/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub(crate) mod range_bounds {

#[cfg(feature = "coroutine_trait")]
pub(crate) mod coroutine {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down
12 changes: 6 additions & 6 deletions src/derive/external/futures03.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod async_buf_read {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -54,7 +54,7 @@ pub(crate) mod async_buf_read {
}

pub(crate) mod async_read {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -113,7 +113,7 @@ pub(crate) mod async_read {
}

pub(crate) mod async_seek {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -153,7 +153,7 @@ pub(crate) mod async_seek {
}

pub(crate) mod async_write {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -246,7 +246,7 @@ pub(crate) mod async_write {
}

pub(crate) mod sink {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -338,7 +338,7 @@ pub(crate) mod sink {
}

pub(crate) mod stream {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down
2 changes: 1 addition & 1 deletion src/derive/external/http_body1.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod body {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down
8 changes: 4 additions & 4 deletions src/derive/external/tokio02.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod async_buf_read {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -52,7 +52,7 @@ pub(crate) mod async_buf_read {
}

pub(crate) mod async_read {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -105,7 +105,7 @@ pub(crate) mod async_read {
}

pub(crate) mod async_seek {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -160,7 +160,7 @@ pub(crate) mod async_seek {
}

pub(crate) mod async_write {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down
8 changes: 4 additions & 4 deletions src/derive/external/tokio03.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod async_buf_read {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -52,7 +52,7 @@ pub(crate) mod async_buf_read {
}

pub(crate) mod async_read {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -91,7 +91,7 @@ pub(crate) mod async_read {
}

pub(crate) mod async_seek {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -145,7 +145,7 @@ pub(crate) mod async_seek {
}

pub(crate) mod async_write {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down
8 changes: 4 additions & 4 deletions src/derive/external/tokio1.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub(crate) mod async_buf_read {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -52,7 +52,7 @@ pub(crate) mod async_buf_read {
}

pub(crate) mod async_read {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -91,7 +91,7 @@ pub(crate) mod async_read {
}

pub(crate) mod async_seek {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down Expand Up @@ -145,7 +145,7 @@ pub(crate) mod async_seek {
}

pub(crate) mod async_write {
use quote::ToTokens;
use quote::ToTokens as _;

use crate::derive::*;

Expand Down
2 changes: 1 addition & 1 deletion src/derive/ty_impls/transpose.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use quote::ToTokens;
use quote::ToTokens as _;
use syn::TypeParam;

use crate::derive::*;
Expand Down
2 changes: 1 addition & 1 deletion src/enum_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::cell::Cell;

use derive_utils::EnumData as Data;
use proc_macro2::TokenStream;
use quote::{quote, ToTokens};
use quote::{quote, ToTokens as _};
use syn::{
parse::{Parse, ParseStream},
parse_quote, Error, ItemEnum, Path, Result, Token,
Expand Down

0 comments on commit 1be1b0c

Please sign in to comment.