Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett committed Mar 19, 2024
1 parent 1e770d6 commit f83a859
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,13 @@ fn spawn_map_objects(

let paths: HashMap<i32, Vec<Vec2>> = find_objects(tiled_map, "enemy_path")
.filter_map(|o| {
let (points, index) = match (&o.shape, o.properties.get("index")) {
(ObjectShape::Polyline { points }, Some(PropertyValue::IntValue(index)))
| (ObjectShape::Polygon { points }, Some(PropertyValue::IntValue(index))) => {
(points, index)
}
_ => return None,
let Some(PropertyValue::IntValue(index)) = o.properties.get("index") else {
return None;
};

let (ObjectShape::Polyline { points } | ObjectShape::Polygon { points }) = &o.shape
else {
return None;
};

let transformed: Vec<Vec2> = points
Expand Down

0 comments on commit f83a859

Please sign in to comment.