-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix unused error in app.rs * fix unused error in scalar.rs * fix unused error in expand object.rs * fix dead code warnings
- Loading branch information
Showing
7 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use quote::quote; | ||
|
||
use proc_macro2::TokenStream; | ||
use syn::Generics; | ||
|
||
pub fn impl_suppress_tupple_clippy_error( | ||
ident: &syn::Ident, | ||
generics: &Generics, | ||
len: usize, | ||
) -> TokenStream { | ||
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); | ||
let accesses: TokenStream = (0..len) | ||
.map(|index| { | ||
let index = syn::Index::from(index); | ||
quote! { | ||
let _ = self.#index; | ||
} | ||
}) | ||
.collect(); | ||
quote! { | ||
impl #impl_generics #ident #ty_generics #where_clause { | ||
#[allow(dead_code)] | ||
#[doc(hidden)] | ||
fn _suppress_clippy_error(&self) { | ||
#accesses | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters