Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "mousefood"
description = "embedded-graphics backend for Ratatui"
version = "0.2.1"
edition = "2021"
edition = "2024"
license = "MIT OR Apache-2.0"
readme = "README.md"
homepage = "https://github.com/j-g00da/mousefood"
Expand Down
2 changes: 1 addition & 1 deletion src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
use crate::default_font;
use crate::error::DrawError;
use crate::framebuffer;
use embedded_graphics::Drawable;
use embedded_graphics::draw_target::DrawTarget;
use embedded_graphics::geometry::{self, Dimensions};
use embedded_graphics::mono_font::{MonoFont, MonoTextStyleBuilder};
use embedded_graphics::pixelcolor::{PixelColor, Rgb888};
use embedded_graphics::text::Text;
use embedded_graphics::Drawable;
#[cfg(feature = "simulator")]
use embedded_graphics_simulator::{OutputSettings, SimulatorDisplay, SimulatorEvent, Window};
use ratatui::backend::Backend;
Expand Down Expand Up @@ -213,7 +213,7 @@
style_builder.build(),
)
.draw(&mut self.buffer)
.map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError))?;

Check warning on line 216 in src/backend.rs

View workflow job for this annotation

GitHub Actions / Run clippy

this can be `std::io::Error::other(_)`

warning: this can be `std::io::Error::other(_)` --> src/backend.rs:216:26 | 216 | .map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error = note: `#[warn(clippy::io_other_error)]` on by default help: use `std::io::Error::other` | 216 - .map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError))?; 216 + .map_err(|_| io::Error::other(DrawError))?; |
}
Ok(())
}
Expand Down Expand Up @@ -244,7 +244,7 @@
fn clear(&mut self) -> io::Result<()> {
self.buffer
.clear(TermColor(ratatui::style::Color::Reset, TermColorType::Background).into())
.map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError))

Check warning on line 247 in src/backend.rs

View workflow job for this annotation

GitHub Actions / Run clippy

this can be `std::io::Error::other(_)`

warning: this can be `std::io::Error::other(_)` --> src/backend.rs:247:26 | 247 | .map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error help: use `std::io::Error::other` | 247 - .map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError)) 247 + .map_err(|_| io::Error::other(DrawError)) |
}

fn size(&self) -> io::Result<layout::Size> {
Expand All @@ -261,7 +261,7 @@
fn flush(&mut self) -> io::Result<()> {
self.display
.fill_contiguous(&self.display.bounding_box(), &self.buffer)
.map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError))?;

Check warning on line 264 in src/backend.rs

View workflow job for this annotation

GitHub Actions / Run clippy

this can be `std::io::Error::other(_)`

warning: this can be `std::io::Error::other(_)` --> src/backend.rs:264:26 | 264 | .map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error help: use `std::io::Error::other` | 264 - .map_err(|_| io::Error::new(io::ErrorKind::Other, DrawError))?; 264 + .map_err(|_| io::Error::other(DrawError))?; |
(self.flush_callback)(self.display);
#[cfg(feature = "simulator")]
self.update_simulation()?;
Expand Down
4 changes: 2 additions & 2 deletions src/colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ impl From<TermColor> for weact_studio_epd::TriColor {
#[cfg(test)]
mod tests {
use super::*;
use paste::paste;
use rstest::rstest;
use Color::*;
use TermColorType::*;
use paste::paste;
use rstest::rstest;

macro_rules! into_eg_color {
($color_type:ident) => {
Expand Down
4 changes: 2 additions & 2 deletions src/framebuffer.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::colors::{TermColor, TermColorType};
use alloc::vec::IntoIter;
use embedded_graphics::Pixel;
use embedded_graphics::draw_target::DrawTarget;
use embedded_graphics::geometry::Dimensions;
use embedded_graphics::pixelcolor::PixelColor;
use embedded_graphics::primitives::Rectangle;
use embedded_graphics::Pixel;
use ratatui::style::Color;

pub(crate) struct HeapBuffer<C: PixelColor + Copy> {
Expand Down Expand Up @@ -71,8 +71,8 @@ mod tests {
use rstest::{fixture, rstest};

use embedded_graphics::mock_display::MockDisplay;
use embedded_graphics::mono_font::ascii::FONT_4X6;
use embedded_graphics::mono_font::MonoTextStyle;
use embedded_graphics::mono_font::ascii::FONT_4X6;
use embedded_graphics::pixelcolor::{Rgb888, RgbColor};
use embedded_graphics::prelude::*;
use embedded_graphics::text::Text;
Expand Down