I commonly have to work with geometric data, in C++ it was normal for me to do things like this:
struct Vertex { vec2;}
vector<Vertex> triangle = {{-1, 0}, {0,1}, {1, 0}};
Which is fairly convenient, especially if you start having more nested types, like adding more fields to Vertex.
In rust initializers need to be explicit, so i get things like this:
let triangle : [Vertex; 3] = [
Vertex{position : Vec2::new(-0.5, 0.0), color : Vec3::new(1.0, 0.0, 0.0)},
Vertex{position : Vec2::new(0.0, 0.5), color : Vec3::new(0.0, 1.0, 0.0)},
Vertex{position : Vec2::new(0.5, 0.0), color : Vec3::new(0.0, 0.0, 1.0)},
];
This is a little too much, it becomes tedious to specify the same fields over and over again, and this is not even that bad of a scenario, when you have position, normal and uv fields it becomes a mess.
Is there a way to initialise lists in a more compact way?