diff options
Diffstat (limited to 'src/display')
-rw-r--r-- | src/display/color.rs | 10 | ||||
-rw-r--r-- | src/display/draw_box.rs | 2 | ||||
-rw-r--r-- | src/display/mod.rs | 10 | ||||
-rw-r--r-- | src/display/viewport.rs | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/display/color.rs b/src/display/color.rs index 2a023f1d9564..b1e799c5ed9f 100644 --- a/src/display/color.rs +++ b/src/display/color.rs @@ -16,21 +16,21 @@ impl Color { } impl color::Color for Color { - fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn write_fg(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.write_fg(f) } - fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn write_bg(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.write_bg(f) } } impl<'a> color::Color for &'a Color { - fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn write_fg(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.write_fg(f) } - fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn write_bg(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.write_bg(f) } } @@ -56,7 +56,7 @@ impl ColorVisitor { impl<'de> Visitor<'de> for ColorVisitor { type Value = Color; - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.write_str("A color") } diff --git a/src/display/draw_box.rs b/src/display/draw_box.rs index 3b2b4aaf4f1d..1b3958cefca8 100644 --- a/src/display/draw_box.rs +++ b/src/display/draw_box.rs @@ -140,7 +140,7 @@ impl Stylable for Line { } impl Stylable for Neighbors<Option<BoxStyle>> { - fn style(&self, style: BoxStyle) -> char { + fn style(&self, _style: BoxStyle) -> char { use BoxStyle::*; match (self.left, self.right, self.top, self.bottom) { (None, None, None, None) => BOX, diff --git a/src/display/mod.rs b/src/display/mod.rs index 2df4277f4fa7..6e37a03d8c55 100644 --- a/src/display/mod.rs +++ b/src/display/mod.rs @@ -17,17 +17,17 @@ pub fn clear<T: Write>(out: &mut T) -> io::Result<()> { pub trait Draw: Positioned { /// Draw this entity, assuming the character is already at the correct /// position - fn do_draw(&self, out: &mut Write) -> io::Result<()>; + fn do_draw(&self, out: &mut dyn Write) -> io::Result<()>; } impl<T: Draw> Draw for &T { - fn do_draw(&self, out: &mut Write) -> io::Result<()> { + fn do_draw(&self, out: &mut dyn Write) -> io::Result<()> { (**self).do_draw(out) } } impl<T: Draw> Draw for Box<T> { - fn do_draw(&self, out: &mut Write) -> io::Result<()> { + fn do_draw(&self, out: &mut dyn Write) -> io::Result<()> { (**self).do_draw(out) } } @@ -36,7 +36,7 @@ pub trait DrawWithNeighbors: Positioned { #[allow(clippy::borrowed_box)] fn do_draw_with_neighbors<'a, 'b>( &'a self, - out: &'b mut Write, + out: &'b mut dyn Write, neighbors: &'a Neighbors<Vec<&'a Box<dyn Entity>>>, ) -> io::Result<()>; } @@ -44,7 +44,7 @@ pub trait DrawWithNeighbors: Positioned { impl<T: Draw> DrawWithNeighbors for T { fn do_draw_with_neighbors<'a, 'b>( &'a self, - out: &'b mut Write, + out: &'b mut dyn Write, _neighbors: &'a Neighbors<Vec<&'a Box<dyn Entity>>>, ) -> io::Result<()> { self.do_draw(out) diff --git a/src/display/viewport.rs b/src/display/viewport.rs index 5ff56be0a909..9d17bc87dcff 100644 --- a/src/display/viewport.rs +++ b/src/display/viewport.rs @@ -68,7 +68,7 @@ impl<W> Viewport<W> { } impl<W> Debug for Viewport<W> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, "Viewport {{ outer: {:?}, inner: {:?}, out: <OUT> }}", |