tiny changes to rustical_xml

This commit is contained in:
Lennart
2025-05-14 19:43:09 +02:00
parent 8f69bc839a
commit 1436af1f9c
3 changed files with 24 additions and 36 deletions

View File

@@ -0,0 +1,16 @@
pub(crate) fn get_generic_type(ty: &syn::Type) -> Option<&syn::Type> {
if let syn::Type::Path(syn::TypePath { path, .. }) = ty {
if let Some(seg) = path.segments.last() {
if let syn::PathArguments::AngleBracketed(syn::AngleBracketedGenericArguments {
args,
..
}) = &seg.arguments
{
if let Some(syn::GenericArgument::Type(t)) = &args.first() {
return Some(t);
}
}
}
}
None
}