diff --git a/src/surface.rs b/src/surface.rs index 0509b23..1171f2d 100644 --- a/src/surface.rs +++ b/src/surface.rs @@ -22,16 +22,11 @@ impl fmt::Debug for Surface { /// Errors that may happen when locking the front buffer #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum FrontBufferError { - /// An unknown error happened - Unknown, -} +pub struct FrontBufferError; impl fmt::Display for FrontBufferError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - FrontBufferError::Unknown => write!(f, "Unknown error"), - } + write!(f, "Unknown error") } } @@ -74,7 +69,7 @@ impl Surface { }; Ok(buffer) } else { - Err(FrontBufferError::Unknown) + Err(FrontBufferError) } }