1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use crate::types::Rect; pub trait Screen { fn width(&mut self) -> u32; fn height(&mut self) -> u32; } impl Screen for Rect { fn width(&mut self) -> u32 { self.width.into() } fn height(&mut self) -> u32 { self.width.into() } }