uniffi-rs icon indicating copy to clipboard operation
uniffi-rs copied to clipboard

uniffi should pass sequence arguments as slices

Open eoger opened this issue 3 years ago • 1 comments

Right now uniffi will call Rust using owned vectors, which isn't super idiomatic, we should special case this and pass &[T] instead.

┆Issue is synchronized with this Jira Task ┆Issue Number: UNIFFI-14

eoger avatar Aug 10 '20 23:08 eoger

That sounds great! We could always add an Owned or ByVal (to match ByRef) annotation or something if a Rust function needs to take ownership of the sequence and calling .clone() is too expensive. But &[T] sounds perfect for the default.

linabutler avatar Aug 14 '20 17:08 linabutler

Any progress on this?

conanoc avatar Mar 08 '23 06:03 conanoc

[ByRef] sequence<T> in argument position in the UDL works as expected.

badboy avatar Mar 13 '23 14:03 badboy