Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
paultag committed Oct 5, 2024
1 parent bdb1b2c commit 365d71e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/epson_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,10 @@ impl TryFrom<image::ImageBuffer<image::Luma<u8>, Vec<u8>>> for ImageBuffer {
for x in (0..width).step_by(8) {
let mut block: u8 = 0;
for bit in 0..8 {
match img.get_pixel_checked(x + bit, y) {
Some(pixel) => {
if pixel.0[0] <= 128 {
block |= 1 << (7 - bit)
}
if let Some(pixel) = img.get_pixel_checked(x + bit, y) {
if pixel.0[0] <= 128 {
block |= 1 << (7 - bit)
}
None => {}
}
}
pixels.push(block);
Expand Down
5 changes: 3 additions & 2 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ impl std::fmt::Display for Error {
}
}

///
/// Result-type used by this file.
type Result<T> = std::result::Result<T, Error>;

///
/// Writer to be used in order to communicate with an Epson brand thermal
/// printer.
pub struct Writer {
w: Box<dyn Write>,
model: Model,
Expand Down

0 comments on commit 365d71e

Please sign in to comment.