diff --git a/src/device/mod.rs b/src/device/mod.rs index 09a689a..9d2d49f 100644 --- a/src/device/mod.rs +++ b/src/device/mod.rs @@ -59,15 +59,6 @@ pub trait Device: Send { fn color_correction(&self) -> Correction { Correction::none() } - - fn written_frame_size(&self, num_pixels: usize) -> usize { - let mut buf = Vec::new(); - let dummy_frame: Vec = (0..num_pixels) - .map(|_| Pixel { r: 0, g: 0, b: 0 }) - .collect(); - self.write_frame(&mut buf, dummy_frame.as_slice()).unwrap(); - buf.len() - } } impl Device for Box diff --git a/src/driver/mod.rs b/src/driver/mod.rs index d15f9e3..b57fad5 100644 --- a/src/driver/mod.rs +++ b/src/driver/mod.rs @@ -40,7 +40,14 @@ impl fmt::Display for Error { } } -impl error::Error for Error {} +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + match &self { + Self::Io(err) => Some(err), + Self::Nix(err) => Some(err), + } + } +} impl From for Error { fn from(err: io::Error) -> Self {