- let mut is_ref = if let syn::Type::Reference(_) = *arg.ty { true } else { false };
- if let syn::Type::Reference(syn::TypeReference { ref elem, .. }) = *arg.ty {
- if let syn::Type::Slice(_) = &**elem {
- // Slices are mapped to non-ref Vec types, so we want them to be mut
- // letting us drain(..) the underlying Vec.
- is_ref = false;
- }
- }
+ // First get the c type so that we can check if it ends up being a reference:
+ let mut c_type = Vec::new();
+ types.write_c_type(&mut c_type, &*arg.ty, generics, false);