Appease Clippy.

This commit is contained in:
Nolan Darilek 2021-07-13 12:24:33 -05:00
parent 1391856478
commit fc9e561be7
2 changed files with 7 additions and 7 deletions

View File

@ -65,7 +65,7 @@ impl
.0
.iter()
.filter(|(a, _, _, _)| query.1.get(*a).is_ok())
.map(|(a, b, c, d)| (a, b.clone(), c.clone(), d.clone()))
.map(|(a, b, c, d)| (a, *b, c.clone(), *d))
.collect::<Vec<(Entity, ColliderPosition, ColliderShape, ColliderFlags)>>();
let mut m = HashMap::new();
for (e, a, b, c) in entries {
@ -168,7 +168,7 @@ fn find_path_for_shape(
successors
},
|p| (p.distance_squared(&destination) * 100.) as u32,
|p| *p == destination.into(),
|p| *p == destination,
);
channel_clone
.send(if let Some(path) = path {
@ -211,9 +211,9 @@ fn calculate_path(
}
}
for (entity, destination, coordinates, shape) in query.iter() {
if !calculating.contains_key(&entity) {
if let std::collections::hash_map::Entry::Vacant(e) = calculating.entry(entity) {
let (tx, rx) = unbounded();
calculating.insert(entity, rx);
e.insert(rx);
for map in map.iter() {
find_path_for_shape(
&*pool,

View File

@ -141,7 +141,7 @@ fn update_viewshed(
);
}
fn update_viewshed_for_coordinates<'a>(
fn update_viewshed_for_coordinates(
visible: Query<(&Coordinates, &BlocksVisibility), Changed<Coordinates>>,
mut viewers: Query<(Entity, &mut Viewshed, &Coordinates)>,
map: Query<&Map>,
@ -169,7 +169,7 @@ fn update_viewshed_for_coordinates<'a>(
}
}
fn update_viewshed_for_start<'a>(
fn update_viewshed_for_start(
mut viewers: Query<(Entity, &mut Viewshed, &Coordinates), Changed<Coordinates>>,
map: Query<&Map>,
query_pipeline: Res<QueryPipeline>,
@ -191,7 +191,7 @@ fn update_viewshed_for_start<'a>(
}
}
fn remove_blocks_visibility<'a>(
fn remove_blocks_visibility(
removed: RemovedComponents<BlocksVisibility>,
mut viewers: Query<(Entity, &mut Viewshed, &Coordinates)>,
map: Query<&Map>,