Look inside of None-delimited groups when examining types

This commit is contained in:
David Tolnay
2020-05-29 17:58:34 -07:00
parent f7d06cae4c
commit c45a809d5c
5 changed files with 21 additions and 12 deletions
+9
View File
@@ -8,8 +8,17 @@ mod case;
mod check;
mod symbol;
use syn::Type;
#[derive(Copy, Clone)]
pub enum Derive {
Serialize,
Deserialize,
}
pub fn ungroup(mut ty: &Type) -> &Type {
while let Type::Group(group) = ty {
ty = &group.elem;
}
ty
}