Skip to content

Commit 55ac2a5

Browse files
committed
[web] Fix clippy complaint (n%2==0 should be n.is_multiple_of(2)).
1 parent 82ce9ec commit 55ac2a5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tx2-web/rust/src/io/keyboard.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,8 @@ impl HtmlCanvas2DPainter {
630630
}
631631
let x_midline = (bbox.left() + bbox.right()) / 2.0;
632632
let y_midline = (bbox.top() + bbox.bottom()) / 2.0;
633-
fn even(n: usize) -> bool {
634-
n % 2 == 0
635-
}
636633
fn yi(i: usize, n: usize, y_midline: f64, a: f64, d: f64) -> f64 {
637-
let ashift: f64 = if even(n) { a } else { 0.0 };
634+
let ashift: f64 = if n.is_multiple_of(2) { a } else { 0.0 };
638635
fn f(x: usize) -> f64 {
639636
f64::value_from(x).unwrap_or(f64::MAX)
640637
}

0 commit comments

Comments
 (0)