Fix unused import warnings

This commit is contained in:
Dario Nieuwenhuis 2021-03-29 21:34:15 +02:00
parent 403b308279
commit 02ae53e71b
3 changed files with 5 additions and 10 deletions

View file

@ -1,4 +1,4 @@
use crate::fmt::{assert, *}; use crate::fmt::assert;
pub struct RingBuffer<'a> { pub struct RingBuffer<'a> {
buf: &'a mut [u8], buf: &'a mut [u8],

View file

@ -1,12 +1,11 @@
use darling::FromMeta; use darling::FromMeta;
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::{format_ident, quote}; use quote::quote;
use syn::spanned::Spanned;
#[derive(Debug, FromMeta)] #[derive(Debug, FromMeta)]
pub struct Args {} pub struct Args {}
pub fn generate(args: Args) -> TokenStream { pub fn generate(_args: Args) -> TokenStream {
quote!( quote!(
use embassy_rp::{interrupt, peripherals}; use embassy_rp::{interrupt, peripherals};

View file

@ -207,7 +207,7 @@ mod chip;
#[proc_macro_attribute] #[proc_macro_attribute]
pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
let macro_args = syn::parse_macro_input!(args as syn::AttributeArgs); let macro_args = syn::parse_macro_input!(args as syn::AttributeArgs);
let mut task_fn = syn::parse_macro_input!(item as syn::ItemFn); let task_fn = syn::parse_macro_input!(item as syn::ItemFn);
let macro_args = match chip::Args::from_list(&macro_args) { let macro_args = match chip::Args::from_list(&macro_args) {
Ok(v) => v, Ok(v) => v,
@ -236,9 +236,7 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
fail = true; fail = true;
} }
let mut arg_names: syn::punctuated::Punctuated<syn::Ident, syn::Token![,]> = let args = task_fn.sig.inputs.clone();
syn::punctuated::Punctuated::new();
let mut args = task_fn.sig.inputs.clone();
if args.len() != 1 { if args.len() != 1 {
task_fn task_fn
@ -254,9 +252,7 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
return TokenStream::new(); return TokenStream::new();
} }
let name = task_fn.sig.ident.clone();
let task_fn_body = task_fn.block.clone(); let task_fn_body = task_fn.block.clone();
let chip_setup = chip::generate(macro_args); let chip_setup = chip::generate(macro_args);
let result = quote! { let result = quote! {