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