diff options
Diffstat (limited to 'src/syn_utils.rs')
-rw-r--r-- | src/syn_utils.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/syn_utils.rs b/src/syn_utils.rs index ea4b5ea..00efee0 100644 --- a/src/syn_utils.rs +++ b/src/syn_utils.rs @@ -23,6 +23,15 @@ pub fn lifetime_bounds<T>( }) } +pub fn type_arguments_mut<P>( + args: &mut Punctuated<GenericArgument, P>, +) -> impl Iterator<Item = &mut Type> { + args.iter_mut().filter_map(|a| match a { + GenericArgument::Type(t) => Some(t), + _other => None, + }) +} + pub enum TypeOrPath<'a> { Type(&'a Type), Path(&'a Path), |