Fixed warning - irrefutable let pattern
authorTomas Wenström <tomas.wenstrom@gmail.com>
Sun, 7 Feb 2021 16:49:24 +0000 (17:49 +0100)
committerTomas Wenström <tomas.wenstrom@gmail.com>
Sun, 7 Feb 2021 16:49:24 +0000 (17:49 +0100)
src/core/level/mod.rs

index 5df8ba6..84d4fad 100644 (file)
@@ -99,15 +99,13 @@ impl Level {
 
     pub fn intersect_walls(&self, p1: Point<f64>, p2: Point<f64>) -> IntersectResult {
        for c in self.wall_grid.grid_coordinates_on_line(p1, p2) {
-           if let walls = &self.wall_grid.cells[c.x][c.y] {
-               for w in walls {
-                   if let Intersection::Point(p) = Intersection::lines(p1, p2, w.p1, w.p2) {
-                       let wall = Wall {
-                           region: &self.walls[w.region],
-                           edge: w,
-                       };
-                       return IntersectResult::Intersection(wall, p)
-                   }
+           for w in &self.wall_grid.cells[c.x][c.y] {
+               if let Intersection::Point(p) = Intersection::lines(p1, p2, w.p1, w.p2) {
+                   let wall = Wall {
+                       region: &self.walls[w.region],
+                       edge: w,
+                   };
+                   return IntersectResult::Intersection(wall, p)
                }
            }
        }