diff --git a/mady_macro_core/src/annotator.rs b/mady_macro_core/src/annotator.rs index b5d2bfc..035be79 100644 --- a/mady_macro_core/src/annotator.rs +++ b/mady_macro_core/src/annotator.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use crate::error::ParseError; use crate::gen::Chain; -use crate::utils::{null, ops_to_string, Marker}; +use crate::utils::{ops_to_string, Marker}; use proc_macro2::TokenStream; use syn::parse_quote; diff --git a/mady_macro_core/src/folder.rs b/mady_macro_core/src/folder.rs index 25ba57e..1d0136a 100644 --- a/mady_macro_core/src/folder.rs +++ b/mady_macro_core/src/folder.rs @@ -6,7 +6,7 @@ use crate::gen::Chain; use crate::generator::gen_backward; use crate::utils::{grad_method, ops_to_string}; -use crate::parser::{Parser, Recorder, Register, VarType}; +use crate::parser::{Parser, Recorder, Register}; #[derive(Default)] pub struct Folder; diff --git a/mady_macro_core/src/lib.rs b/mady_macro_core/src/lib.rs index 53845f3..6851040 100644 --- a/mady_macro_core/src/lib.rs +++ b/mady_macro_core/src/lib.rs @@ -31,7 +31,7 @@ mod tests { fn gen() { let ts = parse_quote! { fn a(a:usize,b:usize) -> usize { - a.mul(b) + a.mul(b) } }; diff --git a/mady_macro_core/src/utils.rs b/mady_macro_core/src/utils.rs index 0a5295b..67783ff 100644 --- a/mady_macro_core/src/utils.rs +++ b/mady_macro_core/src/utils.rs @@ -1,4 +1,4 @@ -use crate::graph::{Edge, Graph, Node}; +use crate::graph::Node; use crate::parser::{Id, ParseGraph, Var, VarType}; use proc_macro2::{Ident, TokenStream}; use quote::{format_ident, quote}; @@ -77,7 +77,7 @@ impl Marker { T: ToString, { let ty = method_node.to_type_ident(); - let tys = arg_nodes.into_iter().map(|x| x.to_type_ident()); + let tys = arg_nodes.iter().map(|x| x.to_type_ident()); let ty_trait = format_ident!("Grad{}", to_upper_camel_case(method_name.to_string())); Self {