There are a lot of functions for building things that aren't declared as constant, even though they are constant.
The example that gets me the most is bevy_render::mesh::shape::Box::new isn't a const even though it's literally:
pub fn new(x_length: f32, y_length: f32, z_length: f32) -> Box {
Box {
max_x: x_length / 2.0,
min_x: -x_length / 2.0,
max_y: y_length / 2.0,
min_y: -y_length / 2.0,
max_z: z_length / 2.0,
min_z: -z_length / 2.0,
}
}
and really has no reason not to be const. This is just an example, but there are tons of functions that should be constant.
In the end this is just a suggestion, bevy is already huge so it might be unrealistic to go through it all again and figure out what can and can't be const, I'm just trying to bring attention to it.
There are a lot of functions for building things that aren't declared as constant, even though they are constant.
The example that gets me the most is
bevy_render::mesh::shape::Box::newisn't aconsteven though it's literally:and really has no reason not to be
const. This is just an example, but there are tons of functions that should be constant.In the end this is just a suggestion, bevy is already huge so it might be unrealistic to go through it all again and figure out what can and can't be
const, I'm just trying to bring attention to it.