aboutsummaryrefslogtreecommitdiff
path: root/macros/src/util/item_impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/util/item_impl.rs')
-rw-r--r--macros/src/util/item_impl.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/macros/src/util/item_impl.rs b/macros/src/util/item_impl.rs
index 271ae2f..4bd7492 100644
--- a/macros/src/util/item_impl.rs
+++ b/macros/src/util/item_impl.rs
@@ -1,13 +1,13 @@
use syn::{ImplItem, ImplItemMethod, ItemImpl};
-pub fn find_impl_method_by_name<'item_impl>(
- item_impl: &'item_impl ItemImpl,
+pub fn find_impl_method_by_name_mut<'item_impl>(
+ item_impl: &'item_impl mut ItemImpl,
method_name: &'static str,
-) -> Option<&'item_impl ImplItemMethod>
+) -> Option<&'item_impl mut ImplItemMethod>
{
- let impl_items = &item_impl.items;
+ let impl_items = &mut item_impl.items;
- impl_items.iter().find_map(|impl_item| match impl_item {
+ impl_items.iter_mut().find_map(|impl_item| match impl_item {
ImplItem::Method(method_item) => {
if method_item.sig.ident == method_name {
Some(method_item)
@@ -15,6 +15,6 @@ pub fn find_impl_method_by_name<'item_impl>(
None
}
}
- &_ => None,
+ &mut _ => None,
})
}