1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
pub struct Size { pub w: f64, pub h: f64 } impl Size { pub fn new(w: f64, h: f64) -> Self { Self { w, h } } } impl Into<Size> for (f64, f64) { fn into(self) -> Size { Size { w: self.0, h: self.1 } } }