Skip to content

Commit

Permalink
🔥 Remove a redundant import of crate itself
Browse files Browse the repository at this point in the history
Otherwise clippy complains about it:

```rust
 error: the item `syn` is imported redundantly
  --> zvariant_derive/src/lib.rs:14:11
   |
14 | use syn::{self, DeriveInput};
   |           ^^^^ the item `syn` is already defined here
   |
   = note: `-D unused-imports` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: the item `syn` is imported redundantly
 --> zvariant_derive/src/type.rs:4:5
  |
4 |     self, spanned::Spanned, Attribute, Data, DataEnum, DeriveInput, Error, Fields, Generics, Ident,
  |     ^^^^ the item `syn` is already defined here

error: the item `syn` is imported redundantly
 --> zvariant_derive/src/value.rs:4:5
  |
4 |     self, spanned::Spanned, Attribute, Data, DataEnum, DeriveInput, Error, Expr, Fields, Generics,
  |     ^^^^ the item `syn` is already defined here

   Compiling aho-corasick v1.1.2
   Compiling memoffset v0.9.0
    Checking utf8parse v0.2.1
error: could not compile `zvariant_derive` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.
```
  • Loading branch information
zeenix committed Feb 19, 2024
1 parent 1f1d12d commit 476275b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion zvariant_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)))]

use proc_macro::TokenStream;
use syn::{self, DeriveInput};
use syn::DeriveInput;

mod dict;
mod r#type;
Expand Down
2 changes: 1 addition & 1 deletion zvariant_derive/src/type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use proc_macro2::TokenStream;
use quote::{quote, ToTokens};
use syn::{
self, spanned::Spanned, Attribute, Data, DataEnum, DeriveInput, Error, Fields, Generics, Ident,
spanned::Spanned, Attribute, Data, DataEnum, DeriveInput, Error, Fields, Generics, Ident,
};

use crate::utils::*;
Expand Down
2 changes: 1 addition & 1 deletion zvariant_derive/src/value.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use syn::{
self, spanned::Spanned, Attribute, Data, DataEnum, DeriveInput, Error, Expr, Fields, Generics,
spanned::Spanned, Attribute, Data, DataEnum, DeriveInput, Error, Expr, Fields, Generics,
Ident, Lifetime, LifetimeDef,
};

Expand Down

0 comments on commit 476275b

Please sign in to comment.