We have various functions that take a slice as argument currently. Most of them would convert the slice into a Vec<*mut _> or similar before passing to C functions. As such it would make sense to directly allow using anything that can be iterated over.
For functions taking some plain type T this is straightforward (e.g. &[&str] would become impl IntoIterator<Item = &str>), for functions taking a &dyn T (e.g. &[&dyn ToValue]) this is a bit problematic because of https://github.com/rust-lang/rust/issues/89222.
Because of that I would suggest to only do it for slices that are not containing trait objects for now, unless someone knows a way around that.
We have various functions that take a slice as argument currently. Most of them would convert the slice into a
Vec<*mut _>
or similar before passing to C functions. As such it would make sense to directly allow using anything that can be iterated over.For functions taking some plain type
T
this is straightforward (e.g.&[&str]
would becomeimpl IntoIterator<Item = &str>
), for functions taking a&dyn T
(e.g.&[&dyn ToValue]
) this is a bit problematic because of https://github.com/rust-lang/rust/issues/89222.Because of that I would suggest to only do it for slices that are not containing trait objects for now, unless someone knows a way around that.
@bilelmoussaoui @GuillaumeGomez Any opinions?