Skip to content

Commit 66d7f7f

Browse files
Armin BecherArmin Becher
authored andcommitted
style: fix clippy warnings
1 parent fac87b5 commit 66d7f7f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ mod tests {
303303
let mut lut_3: [u8; 256] = [0; 256];
304304
for input in 0..=255 {
305305
//for input in 4..=4 {
306-
let mut state: u8 = (input as u8 & 0b11000000) >> 4;
306+
let mut state: u8 = (input & 0b11000000) >> 4;
307307
let mut result: u8 = 0;
308308
let mut x_mask: u8 = 0b00100000;
309309
let mut y_mask: u8 = 0b00000100;
@@ -329,7 +329,7 @@ mod tests {
329329
let mut lut_3: [u8; 256] = [0; 256];
330330
for input in 0..=255 {
331331
//for input in 4..=4 {
332-
let mut state: u8 = (input as u8 & 0b11000000) >> 6;
332+
let mut state: u8 = (input & 0b11000000) >> 6;
333333
let mut result: u8 = 0;
334334
let mut h_mask: u8 = 0b00110000;
335335
for i in 0..3 {
@@ -402,7 +402,7 @@ mod tests {
402402
let h2xy = h2xy::<u32>;
403403
for h in 0..8 {
404404
let (rx, ry) = h2xy(h as u64, 2);
405-
let h_cmp = xy2h(rx as u32, ry as u32, 2);
405+
let h_cmp = xy2h(rx, ry, 2);
406406
assert_eq!(h, h_cmp as usize);
407407
}
408408
}
@@ -423,7 +423,7 @@ mod tests {
423423
for &bits in &[1, 2, 3, 5, 8, 13, 16] {
424424
let bits = (bits + 1) & !1;
425425
let numbers = 2usize.pow(bits);
426-
for d in (0..(numbers * numbers)).step_by(numbers as usize) {
426+
for d in (0..(numbers * numbers)).step_by(numbers) {
427427
let (x, y) = hilbert_curve::convert_1d_to_2d(d, numbers);
428428
assert_eq!(xy2h(x as u32, y as u32, bits as u8), d as u64);
429429
}
@@ -454,25 +454,25 @@ mod tests {
454454
continue;
455455
}
456456
while prev.0 < *x {
457-
let pixel = imgbuf.get_pixel_mut(prev.0 as u32, prev.1 as u32);
457+
let pixel = imgbuf.get_pixel_mut(prev.0, prev.1);
458458
*pixel = white;
459459
prev.0 += 1;
460460
continue;
461461
}
462462
while prev.0 > *x {
463-
let pixel = imgbuf.get_pixel_mut(prev.0 as u32, prev.1 as u32);
463+
let pixel = imgbuf.get_pixel_mut(prev.0, prev.1);
464464
*pixel = white;
465465
prev.0 -= 1;
466466
continue;
467467
}
468468
while prev.1 < *y {
469-
let pixel = imgbuf.get_pixel_mut(prev.0 as u32, prev.1 as u32);
469+
let pixel = imgbuf.get_pixel_mut(prev.0, prev.1);
470470
*pixel = white;
471471
prev.1 += 1;
472472
continue;
473473
}
474474
while prev.1 > *y {
475-
let pixel = imgbuf.get_pixel_mut(prev.0 as u32, prev.1 as u32);
475+
let pixel = imgbuf.get_pixel_mut(prev.0, prev.1);
476476
*pixel = white;
477477
prev.1 -= 1;
478478
continue;

0 commit comments

Comments
 (0)