Implement FromIterator/IntoIterator for dynamic types#14250
Implement FromIterator/IntoIterator for dynamic types#14250alice-i-cecile merged 8 commits intobevyengine:mainfrom
Conversation
MrGVSV
left a comment
There was a problem hiding this comment.
Awesome! I think these changes will be super useful!
| } | ||
| } | ||
|
|
||
| impl FromIterator<(String, Box<dyn Reflect>)> for DynamicStruct { |
There was a problem hiding this comment.
These are cool! I've been wanting a succinct way to create DynamicStruct and friends for a long time haha
|
@SpecificProtagonist could you also update the title and description to account for your new changes? |
Yep – already updated the description; accidentally cancelled the edit to the title :3 Do you know what's going on with the compile error? It doesn't appear locally for me, and doesn't make any sense to me either: It says that the return type of |
Looks like For now, I'd recommend just doing: self.values.into_vec().into_iter()It might be a good idea also leaving a |
|
Thanks! Fixed it. Didn't leave a todo as the resulting code is fine. I've also removed the homogeneous |
mweatherley
left a comment
There was a problem hiding this comment.
A couple minor comments, but nothing worth blocking over. Good feature!
Objective
Implement FromIterator/IntoIterator for dynamic types where missing
Note:
IntoIteratorfor&Array& co because of orphan rulesinto_iter().collect()is a no-op forVecs because of specializationMigration Guide
DynamicArray::from_vectoDynamicArray::from_iter