Currently as of v0.12.1
the struct Size<T>
does not implement Default
and I believe it probably should (which is something that is not needed per se, but is idiomatic and simple). I hope there is no problem related to compile sizes or micro-optimizations, but otherwise, it would be applied as the following if I’m not wrong:
impl<T: std::default::Default> std::default::Default for Size<T> {
fn default() -> Self {
Self { width: T::default(), height: T::default() }
}
}
Note: there are consts for (0.0, 0.0)
, (1.0, 1.0)
and infinity, but those are only for Size<f32>
for obvious reasons, and there are no others for any other type T
.