Skip to content

Commit

Permalink
Merge pull request #217 from caemor/fixes
Browse files Browse the repository at this point in the history
Two Clippy improvements
  • Loading branch information
caemor authored Oct 30, 2024
2 parents 1e525bb + ca5ac60 commit 16ca061
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/epd7in5_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ fn main() -> Result<(), SPIError> {
&FONT_9X18_BOLD,
&FONT_10X20,
];
for n in 0..fonts.len() {
for (n, font) in fonts.iter().enumerate() {
let style = MonoTextStyleBuilder::new()
.font(fonts[n])
.font(font)
.text_color(Color::White)
.background_color(Color::Black)
.build();
Expand Down
14 changes: 7 additions & 7 deletions src/epd1in02/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,38 +521,38 @@ mod tests {

#[test]
fn inside_of_screen() {
assert_eq!(is_window_size_ok(0, 0, 80, 128), true);
assert!(is_window_size_ok(0, 0, 80, 128));
}

#[test]
fn x_too_big() {
assert_eq!(is_window_size_ok(8, 8, 80, 1), false);
assert!(!is_window_size_ok(8, 8, 80, 1));
}

#[test]
fn y_too_big() {
assert_eq!(is_window_size_ok(8, 8, 8, 121), false);
assert!(!is_window_size_ok(8, 8, 8, 121));
}

#[test]
fn x_is_not_multiple_of_8() {
assert_eq!(is_window_size_ok(1, 0, 72, 128), false);
assert!(!is_window_size_ok(1, 0, 72, 128));
}

#[test]
fn width_is_not_multiple_of_8() {
assert_eq!(is_window_size_ok(0, 0, 79, 128), false);
assert!(!is_window_size_ok(0, 0, 79, 128));
}

#[test]
fn buffer_size_incorrect() {
let buf = [0u8; 10];
assert_eq!(is_buffer_size_ok(&buf, 10, 10), false);
assert!(!is_buffer_size_ok(&buf, 10, 10));
}

#[test]
fn buffer_size_correct() {
let buf = [0u8; 10];
assert_eq!(is_buffer_size_ok(&buf, 8, 10), true);
assert!(is_buffer_size_ok(&buf, 8, 10));
}
}

0 comments on commit 16ca061

Please sign in to comment.