geometry: cut down on <> noise with associated types

This commit is contained in:
2024-11-29 00:10:52 +01:00
parent 5488f85792
commit 2f9b99c2b0
5 changed files with 100 additions and 106 deletions

View File

@@ -13,7 +13,7 @@ pub trait Shader: Send + Debug {
}
pub trait Surfaces<T: Surface>: Debug {
fn new_surface(&mut self, area: &Rectangle<u8, Virtual>) -> Result<T, io::Error>;
fn new_surface(&mut self, area: &Rectangle<Virtual>) -> Result<T, io::Error>;
}
pub trait Surface: Default + Clone + Debug {
@@ -21,8 +21,8 @@ pub trait Surface: Default + Clone + Debug {
fn set_shader(&mut self, shader: Box<dyn Shader>);
fn clear_shader(&mut self);
fn rect(&self) -> Rectangle<u8, Virtual>;
fn set_rect(&mut self, rect: &Rectangle<u8, Virtual>);
fn rect(&self) -> Rectangle<Virtual>;
fn set_rect(&mut self, rect: &Rectangle<Virtual>);
fn opacity(&self) -> u8;
fn set_opacity(&mut self, opacity: u8);
}