Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy warnings #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions aspect-weave/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub trait Weave: ParseAttributes {
///
/// The default implementation should work out-of-the-box.
fn parse_macro_attributes(attrs: TokenStream) -> syn::Result<Self::MacroAttributes> {
Ok(syn::parse(attrs)?)
syn::parse(attrs)
}

/// A callback that lets you alter the blocks of intercepted methods.
Expand Down Expand Up @@ -64,17 +64,17 @@ pub fn weave_impl_block<W: Weave>(
let main_attributes = W::parse_macro_attributes(attrs)?;

let mut parsed_input: syn::ItemImpl = syn::parse(item)?;
let mut attrs = &mut parsed_input.attrs;
let attrs = &mut parsed_input.attrs;
let main_extra_attributes: Vec<Rc<<W as ParseAttributes>::Type>> =
process_custom_attributes::<W, _, _>(&mut attrs, Rc::new)?;
process_custom_attributes::<W, _, _>(attrs, Rc::new)?;

let mut woven = indexmap::map::IndexMap::new();

for item in parsed_input.items.iter_mut() {
if let syn::ImplItem::Method(item_fn) = item {
let mut attrs = &mut item_fn.attrs;
let attrs = &mut item_fn.attrs;

let method_attrs = process_custom_attributes::<W, _, _>(&mut attrs, Rc::new)?;
let method_attrs = process_custom_attributes::<W, _, _>(attrs, Rc::new)?;

if method_attrs.is_empty() {
continue;
Expand All @@ -92,7 +92,7 @@ pub fn weave_impl_block<W: Weave>(

Ok(WovenImplBlock {
woven_block: parsed_input,
main_attributes: main_attributes,
main_attributes,
woven_fns: woven,
})
}
Expand Down