Closed
Description
What problem does this solve or what need does it fill?
The following does not currently compile:
#[derive(Serialize, Deserialize, MapEntities)]
struct PlayerSaveData {
entity: Entity,
position: Vec2,
velocity: Vec2,
}
#[derive(Serialize, Deserialize, MapEntities)]
struct PlayerSaveStage(#[entities] Vec<PlayerSaveData>);
The problem is that Vec<PlayerSaveData>
does not implement MapEntities. Vec<Entity>
does however. This means I have to manually implement MapEntities
for PlayerSaveStage
even though it's incredibly trivial.
What solution would you like?
Implement MapEntities
for Vec<T>
where T: MapEntities
. This should automatically work for Entity since Entity: MapEntities
.