diff options
Diffstat (limited to 'macros/src/lib.rs')
-rw-r--r-- | macros/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/macros/src/lib.rs b/macros/src/lib.rs index ce91f87..36c6ad7 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -2,7 +2,7 @@ use proc_macro::TokenStream; use proc_macro_error::{proc_macro_error, ResultExt}; use quote::{format_ident, quote}; -use syn::{parse, TraitItem}; +use syn::{parse, ImplItem}; use crate::expectation::Expectation; use crate::mock::Mock; @@ -25,10 +25,11 @@ pub fn mock(input_stream: TokenStream) -> TokenStream let mock_mod_ident = format_ident!("__{mock_ident}"); let method_items = input + .item_impl .items .into_iter() .filter_map(|item| match item { - TraitItem::Method(item_method) => Some(item_method), + ImplItem::Method(item_method) => Some(item_method), _ => None, }) .collect::<Vec<_>>(); |