--- a/rust/land2d/src/lib.rs Tue Nov 06 23:29:12 2018 +0300
+++ b/rust/land2d/src/lib.rs Tue Nov 06 23:45:54 2018 +0300
@@ -151,14 +151,12 @@
while let Some((mut xl, mut xr, y, dir)) = stack.pop() {
let row = &mut self.pixels[y][..];
- while xl > 0 && row.get(xl)
- .map_or(false, |v| *v != border_value && *v != fill_value)
+ while xl > 0 && row[xl] != border_value && row[xl] != fill_value
{
xl -= 1;
}
- while xr < width - 1 && row.get(xr)
- .map_or(false, |v| *v != border_value && *v != fill_value)
+ while xr < width - 1 && row[xr] != border_value && row[xr] != fill_value
{
xr += 1;
}
@@ -171,7 +169,7 @@
let x = xl;
- while xl <= xr && (row[xl] != border_value && row[xl] != fill_value)
+ while xl <= xr && row[xl] != border_value && row[xl] != fill_value
{
row[xl] = fill_value;
xl += 1;