Because of itertools producing a Vec<&T> when performing partition_map, I need a way of converting the result to &Vec<T> and thought as_ref would be fit for the job, but no sadly not working for me:
result:
the trait AsRef<Vec<Box<Ob>>> is not implemented for Vec<&Box<Ob>>
This answer I might be misreading that maybe this sort of conversion isn't supported by as_ref? If not, what's the simplest way to go about it?
To have &Vec<T>, you must somewhere have Vec<T> itself - reference can't point to nowhere. What's the map_partition you're referring to? I'm not able to find it in the docs.
Could you share the code yielding Vec<&V>? Looking at the docs, it seems that partition_map will output containers holding the same type you've returned from the passed closure, so either this closure or the incoming iterator might be giving you something you're not expecting.