Fmt.
This commit is contained in:
@@ -36,13 +36,16 @@ fn main() {
|
|||||||
let width = coordinates
|
let width = coordinates
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(x, _)| *x as usize)
|
.map(|(x, _)| *x as usize)
|
||||||
.max().expect("failed to find max x") + 1;
|
.max()
|
||||||
|
.expect("failed to find max x")
|
||||||
|
+ 1;
|
||||||
|
|
||||||
let height = coordinates
|
let height = coordinates
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(_, y)| *y as usize)
|
.map(|(_, y)| *y as usize)
|
||||||
.max()
|
.max()
|
||||||
.expect("failed to find max y") + 1;
|
.expect("failed to find max y")
|
||||||
|
+ 1;
|
||||||
|
|
||||||
let mut grid_view = vec![State::Empty; width * height].into_boxed_slice();
|
let mut grid_view = vec![State::Empty; width * height].into_boxed_slice();
|
||||||
|
|
||||||
@@ -84,10 +87,12 @@ fn main() {
|
|||||||
|
|
||||||
let (_, area) = areas
|
let (_, area) = areas
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(i, area)| if let Area::Finite(area) = area {
|
.filter_map(|(i, area)| {
|
||||||
Some((i, area))
|
if let Area::Finite(area) = area {
|
||||||
} else {
|
Some((i, area))
|
||||||
None
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.max_by_key(|(_, area)| *area)
|
.max_by_key(|(_, area)| *area)
|
||||||
.expect("failed to find max area");
|
.expect("failed to find max area");
|
||||||
|
|||||||
Reference in New Issue
Block a user