From 8e4ec0943973b96addbe01f4c02f91cf04d081a7 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 5 Dec 2022 21:22:00 +0100 Subject: more code --- evc/src/block.rs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'evc/src/block.rs') diff --git a/evc/src/block.rs b/evc/src/block.rs index 29dd4ba..8d98d55 100644 --- a/evc/src/block.rs +++ b/evc/src/block.rs @@ -1,11 +1,5 @@ -use crate::ser::{Ser, Sink, Source}; +use crate::{ser::{Ser, Sink, Source}, pixel::Pixel}; -#[derive(Copy, Clone, Debug)] -pub struct Pixel { - pub r: u8, - pub g: u8, - pub b: u8, -} #[derive(Clone, Debug)] pub struct Block { @@ -56,14 +50,4 @@ impl Block { Ok(Self { size, inner }) } -} -impl Ser for Pixel { - fn write(&self, sink: &mut impl std::io::Write) -> std::io::Result<()> { - sink.put((self.r, self.g, self.b)) - } - - fn read(source: &mut impl std::io::Read) -> std::io::Result { - let (r, g, b) = source.get()?; - Ok(Self { r, g, b }) - } -} +} \ No newline at end of file -- cgit v1.2.3-70-g09d2