From 02ae53e71ba034268d929bcbaa359200fcb34690 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 29 Mar 2021 21:34:15 +0200 Subject: [PATCH] Fix unused import warnings --- embassy-extras/src/ring_buffer.rs | 2 +- embassy-macros/src/chip/rp.rs | 5 ++--- embassy-macros/src/lib.rs | 8 ++------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/embassy-extras/src/ring_buffer.rs b/embassy-extras/src/ring_buffer.rs index 0ef66f00..dafdd958 100644 --- a/embassy-extras/src/ring_buffer.rs +++ b/embassy-extras/src/ring_buffer.rs @@ -1,4 +1,4 @@ -use crate::fmt::{assert, *}; +use crate::fmt::assert; pub struct RingBuffer<'a> { buf: &'a mut [u8], diff --git a/embassy-macros/src/chip/rp.rs b/embassy-macros/src/chip/rp.rs index 25c6705c..39a418ff 100644 --- a/embassy-macros/src/chip/rp.rs +++ b/embassy-macros/src/chip/rp.rs @@ -1,12 +1,11 @@ use darling::FromMeta; use proc_macro2::TokenStream; -use quote::{format_ident, quote}; -use syn::spanned::Spanned; +use quote::quote; #[derive(Debug, FromMeta)] pub struct Args {} -pub fn generate(args: Args) -> TokenStream { +pub fn generate(_args: Args) -> TokenStream { quote!( use embassy_rp::{interrupt, peripherals}; diff --git a/embassy-macros/src/lib.rs b/embassy-macros/src/lib.rs index 72f0b0ec..885eac11 100644 --- a/embassy-macros/src/lib.rs +++ b/embassy-macros/src/lib.rs @@ -207,7 +207,7 @@ mod chip; #[proc_macro_attribute] pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { 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(¯o_args) { Ok(v) => v, @@ -236,9 +236,7 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { fail = true; } - let mut arg_names: syn::punctuated::Punctuated = - syn::punctuated::Punctuated::new(); - let mut args = task_fn.sig.inputs.clone(); + let args = task_fn.sig.inputs.clone(); if args.len() != 1 { task_fn @@ -254,9 +252,7 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { return TokenStream::new(); } - let name = task_fn.sig.ident.clone(); let task_fn_body = task_fn.block.clone(); - let chip_setup = chip::generate(macro_args); let result = quote! {