diff --git a/src/bin/flat/main.rs b/src/bin/flat/main.rs index 86908bb..d56aed3 100644 --- a/src/bin/flat/main.rs +++ b/src/bin/flat/main.rs @@ -148,14 +148,13 @@ fn draw_ray_2(gc: &mut Vec, space: &Space, base: Vec2, dir: Vec2) { hits.line_to(pos2.x + 1.0, pos2.y - 1.0); } let a = ray.pos; - ray = match ret.end { - Some(r) => r, - None => { - ray = ray.forward(1000.0 / DT); - gc.line_to(ray.pos.x, ray.pos.y); - break; - } - }; + if let Some(r) = ret.end { + ray = r + } else { + ray = ray.forward(1000.0 / DT); + gc.line_to(ray.pos.x, ray.pos.y); + break; + } for p in space.line(a, ray.pos, 10.0) { gc.line_to(p.x, p.y); }