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 fa699a2 commit fe305c9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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: 2 additions & 2 deletions pin-project-internal/src/pin_project/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use proc_macro2::{Span, TokenStream};
use quote::quote;
use syn::{
parse::{Parse, ParseStream},
spanned::Spanned,
spanned::Spanned as _,
Attribute, Error, Ident, Result, Token,
};

use super::PIN;
use crate::utils::{ParseBufferExt, SliceExt};
use crate::utils::{ParseBufferExt as _, SliceExt as _};

pub(super) fn parse_args(attrs: &[Attribute]) -> Result<Args> {
// `(__private(<args>))` -> `<args>`
Expand Down
2 changes: 1 addition & 1 deletion pin-project-internal/src/pin_project/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use syn::{
};

use super::PIN;
use crate::utils::SliceExt;
use crate::utils::SliceExt as _;

// To generate the correct `Unpin` implementation and the projection methods,
// we need to collect the types of the pinned fields.
Expand Down
6 changes: 3 additions & 3 deletions pin-project-internal/src/pin_project/derive.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::{Delimiter, Group, Span, TokenStream};
use quote::{format_ident, quote, quote_spanned, ToTokens};
use quote::{format_ident, quote, quote_spanned, ToTokens as _};
use syn::{
parse_quote, punctuated::Punctuated, token, visit_mut::VisitMut, Attribute, Error, Field,
parse_quote, punctuated::Punctuated, token, visit_mut::VisitMut as _, Attribute, Error, Field,
Fields, FieldsNamed, FieldsUnnamed, Generics, Ident, Index, Item, Lifetime, LifetimeParam,
Meta, Result, Token, Type, Variant, Visibility, WhereClause,
};
Expand All @@ -14,7 +14,7 @@ use super::{
};
use crate::utils::{
determine_lifetime_name, determine_visibility, insert_lifetime_and_bound, ReplaceReceiver,
SliceExt, Variants,
SliceExt as _, Variants,
};

pub(super) fn parse_derive(input: TokenStream) -> Result<TokenStream> {
Expand Down
6 changes: 3 additions & 3 deletions pin-project-internal/src/pinned_drop.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::{Span, TokenStream};
use quote::{format_ident, quote, ToTokens};
use quote::{format_ident, quote, ToTokens as _};
use syn::{
parse_quote, spanned::Spanned, token::Colon, visit_mut::VisitMut, Error, FnArg,
parse_quote, spanned::Spanned as _, token::Colon, visit_mut::VisitMut as _, Error, FnArg,
GenericArgument, Ident, ImplItem, ItemImpl, Pat, PatIdent, PatType, Path, PathArguments,
Result, ReturnType, Signature, Token, Type, TypePath, TypeReference,
};

use crate::utils::{ReplaceReceiver, SliceExt};
use crate::utils::{ReplaceReceiver, SliceExt as _};

pub(crate) fn attribute(args: &TokenStream, mut input: ItemImpl) -> TokenStream {
let res = (|| -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion tests/auxiliary/macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![allow(clippy::missing_panics_doc)]

use proc_macro::TokenStream;
use quote::{format_ident, quote, ToTokens};
use quote::{format_ident, quote, ToTokens as _};
use syn::{parse_quote, Field, FieldMutability, Fields, ItemStruct, Token, Visibility};

fn tokens2(tokens: TokenStream) -> proc_macro2::TokenStream {
Expand Down

0 comments on commit fe305c9

Please sign in to comment.