diff --git a/src/buffers.rs b/src/buffers.rs index cab4f9a..e259597 100644 --- a/src/buffers.rs +++ b/src/buffers.rs @@ -163,7 +163,8 @@ impl SurfacePool { impl Surfaces for SurfacePool { type Surface = S; - fn new_surface(&mut self, area: &Rectangle) -> Result { + type Error = io::Error; + fn new_surface(&mut self, area: &Rectangle) -> Result { let mut surface = S::default(); surface.set_rect(area); self.surfaces.push(surface.clone()); diff --git a/src/render.rs b/src/render.rs index 9d9b0d3..a77cad0 100644 --- a/src/render.rs +++ b/src/render.rs @@ -29,7 +29,8 @@ pub trait Shader: Send + Sync { pub trait Surfaces: Send + Sync { type Surface: Surface; - fn new_surface(&mut self, area: &Rectangle) -> Result; + type Error: Debug; + fn new_surface(&mut self, area: &Rectangle) -> Result; fn render_to(&self, output: &mut S, frame: usize); }