From 7925af1bdc635b747213579fcdab2318d8e7ff94 Mon Sep 17 00:00:00 2001 From: Nicolas <> Date: Wed, 6 Apr 2022 17:41:55 +0200 Subject: [PATCH] Replace dyn with generic --- src/render.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/render.rs b/src/render.rs index c348755..944b071 100644 --- a/src/render.rs +++ b/src/render.rs @@ -15,8 +15,8 @@ pub trait Renderer { fn purge(&mut self) -> Result<(), Error>; } -pub struct WriteRenderer { - out: Box, +pub struct WriteRenderer { + out: T, array: Array2D, } @@ -31,8 +31,8 @@ impl Default for Cell { fn default() -> Self { Cell::Keep } } -impl WriteRenderer { - pub fn new(out: Box, width: usize, height: usize) -> Self { +impl WriteRenderer { + pub fn new(out: T, width: usize, height: usize) -> Self { Self { out, array: Array2D::new(width, height) @@ -40,7 +40,7 @@ impl WriteRenderer { } } -impl Renderer for WriteRenderer { +impl Renderer for WriteRenderer { fn width(&self) -> usize { self.array.width() }