Skip to content

Commit

Permalink
#98 Error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
la10736 committed May 1, 2021
1 parent b0befac commit 65d4487
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/parse/fixture.rs
Expand Up @@ -106,8 +106,13 @@ pub(crate) struct ReplaceFutureAttribute(Vec<syn::Error>);

impl ReplaceFutureAttribute {
pub(crate) fn replace(item_fn: &mut ItemFn) -> Result<(), ErrorsVec> {
Self::default().visit_item_fn_mut(item_fn);
Ok(())
let mut visitor = Self::default();
visitor.visit_item_fn_mut(item_fn);
if visitor.0.is_empty() {
Ok(())
} else {
Err(visitor.0.into())
}
}
}

Expand Down

0 comments on commit 65d4487

Please sign in to comment.