fn wrapper_type(ty: &Type) -> WrapperType {
    if let Type::Path(pt) = ty {
        if pt.qself.is_none() && pt.path.leading_colon.is_none() && pt.path.segments.len() == 1 {
            let segment = &pt.path.segments[0];
            if let syn::PathArguments::AngleBracketed(params) = &segment.arguments {
                if params.args.len() == 1 {
                    if let syn::GenericArgument::Type(_) = &params.args[0] {
                        if segment.ident == "Option" {
                            return WrapperType::Option;
                        } else if segment.ident == "Vec" {
                            return WrapperType::Vec;
                        }
                    }
                }
            }
        }
    }
    WrapperType::Raw
}
/// Finds the wrapper type for the given type. This is used to find out whether the
/// type is an Option<T>, Vec<T>, or just T.
/// This is NOT fool-proof. If the type appears as std::vec::Vec<T> for instance, it
/// won't be recognized. That is one of the reasons this macro is not exported beyond
/// `cm_rust`.
Finds the wrapper type for the given type. This is used to find out whether the
type is an Option, Vec, or just T.
This is NOT fool-proof. If the type appears as std::vec::Vec for instance, it
won't be recognized. That is one of the reasons this macro is not exported beyond
`cm_rust`.
Finds the wrapper type for the given type . This is used to find out whether the type is an Option Vec or just T . This is NOT fool - proof . If the type appears as std :: vec :: Vec for instance it won ' t be recognized . That is one of the reasons this macro is not exported beyond ` cm_rust ` .
fn wrapper_type(ty: &Type) -> WrapperType {
    if let Type::Path(pt) = ty {
        if pt.qself.is_none() && pt.path.leading_colon.is_none() && pt.path.segments.len() == 1 {
            let segment = &pt.path.segments[0];
            if let syn::PathArguments::AngleBracketed(params) = &segment.arguments {
                if params.args.len() == 1 {
                    if let syn::GenericArgument::Type(_) = &params.args[0] {
                        if segment.ident == "Option" {
                            return WrapperType::Option;
                        } else if segment.ident == "Vec" {
                            return WrapperType::Vec;
                        }
                    }
                }
            }
        }
    }
    WrapperType::Raw
}
fn wrapper_type ( ty : & Type ) -> WrapperType { if let Type :: Path ( pt ) = ty { if pt . qself . is_none ( ) && pt . path . leading_colon . is_none ( ) && pt . path . segments . len ( ) == 1 { let segment = & pt . path . segments [ 0 ] ; if let syn :: PathArguments :: AngleBracketed ( params ) = & segment . arguments { if params . args . len ( ) == 1 { if let syn :: GenericArgument :: Type ( _ ) = & params . args [ 0 ] { if segment . ident == " " { return WrapperType :: Option ; } else if segment . ident == " " { return WrapperType :: Vec ; } } } } } } WrapperType :: Raw }
Finds the wrapper type for the given type.
Finds the wrapper type for the given type .
ty
&Type
ty
&Type