fn convert_ret_type(rty: &syn::ReturnType, base: &Option<syn::Ident>) -> syn::ReturnType {
    match rty {
        syn::ReturnType::Default => syn::ReturnType::Default,
        syn::ReturnType::Type(_, ty) => {
            if needs_ref(ty) {
                if ty.clone().into_token_stream().to_string() == "Self" {
                    let base = base.clone().expect("Cannot convert `Self` return type without provided base name.
                            Try: `#[swiggen(Foo)]` in macro");
                    parse_quote!(-> *mut #base)
                } else if ty.clone().into_token_stream().to_string() == "String" {
                    parse_quote!(-> *mut c_char)
                } else {
                    parse_quote!(-> *mut #ty)
                }
            } else {
                parse_quote!(-> #ty)
            }
        }
    }
}
/// Similar to above, make sure that we return primitives when 
/// recognised 
Similar to above, make sure that we return primitives when
recognised
Similar to above make sure that we return primitives when recognised
fn convert_ret_type(rty: &syn::ReturnType, base: &Option<syn::Ident>) -> syn::ReturnType {
    match rty {
        syn::ReturnType::Default => syn::ReturnType::Default,
        syn::ReturnType::Type(_, ty) => {
            if needs_ref(ty) {
                if ty.clone().into_token_stream().to_string() == "Self" {
                    let base = base.clone().expect("Cannot convert `Self` return type without provided base name.
                            Try: `#[swiggen(Foo)]` in macro");
                    parse_quote!(-> *mut #base)
                } else if ty.clone().into_token_stream().to_string() == "String" {
                    parse_quote!(-> *mut c_char)
                } else {
                    parse_quote!(-> *mut #ty)
                }
            } else {
                parse_quote!(-> #ty)
            }
        }
    }
}
fn convert_ret_type ( rty : & syn :: ReturnType , base : & Option < syn :: Ident > ) -> syn :: ReturnType { match rty { syn :: ReturnType :: Default => syn :: ReturnType :: Default , syn :: ReturnType :: Type ( _ , ty ) => { if needs_ref ( ty ) { if ty . clone ( ) . into_token_stream ( ) . to_string ( ) == " " { let base = base . clone ( ) . expect ( " " ) ; parse_quote ! ( mut base ) } else if ty . clone ( ) . into_token_stream ( ) . to_string ( ) == " " { parse_quote ! ( mut c_char ) } else { parse_quote ! ( mut ty ) } } else { parse_quote ! ( ty ) } } } }
Similar to above, make sure that we return primitives when
recognised
Similar to above make sure that we return primitives when recognised
rty
&syn::ReturnType
base
&Option<syn::Ident>
rty
&syn::ReturnType
base
&Option<syn::Ident>