Fix and test returning Vec by reference from C to Rust
diff --git a/macro/src/expand.rs b/macro/src/expand.rs
index d27c15c..e7eece0 100644
--- a/macro/src/expand.rs
+++ b/macro/src/expand.rs
@@ -287,6 +287,7 @@
Type::Ident(ident) if ident == RustString => {
Some(quote!(#call.map(|r| r.as_string())))
}
+ Type::RustVec(_) => Some(quote!(#call.map(|r| r.as_vec()))),
_ => None,
},
Type::Str(_) => Some(quote!(#call.map(|r| r.as_str()))),
@@ -301,6 +302,7 @@
Type::UniquePtr(_) => Some(quote!(::cxx::UniquePtr::from_raw(#call))),
Type::Ref(ty) => match &ty.inner {
Type::Ident(ident) if ident == RustString => Some(quote!(#call.as_string())),
+ Type::RustVec(_) => Some(quote!(#call.as_vec())),
_ => None,
},
Type::Str(_) => Some(quote!(#call.as_str())),