aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/customers/pathfinding.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-18 15:52:12 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-18 15:52:12 +0200
commit1bff001db2914e8ee7bc331a4104592ad6e2e9a3 (patch)
tree28b12471e0dc905a8135123df8ddf400c24ed8b2 /server/src/entity/customers/pathfinding.rs
parent1dd3f549debdffd85639d74248a12dd884c5a59b (diff)
downloadhurrycurry-1bff001db2914e8ee7bc331a4104592ad6e2e9a3.tar
hurrycurry-1bff001db2914e8ee7bc331a4104592ad6e2e9a3.tar.bz2
hurrycurry-1bff001db2914e8ee7bc331a4104592ad6e2e9a3.tar.zst
clippy
Diffstat (limited to 'server/src/entity/customers/pathfinding.rs')
-rw-r--r--server/src/entity/customers/pathfinding.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/server/src/entity/customers/pathfinding.rs b/server/src/entity/customers/pathfinding.rs
index 97bd8328..87ccf391 100644
--- a/server/src/entity/customers/pathfinding.rs
+++ b/server/src/entity/customers/pathfinding.rs
@@ -47,7 +47,7 @@ pub fn find_path(walkable: &HashSet<IVec2>, from: IVec2, to: IVec2) -> Option<Pa
struct Open(i32, IVec2, IVec2, i32);
impl PartialOrd for Open {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
- self.0.partial_cmp(&other.0)
+ Some(self.0.cmp(&other.0))
}
}
impl Ord for Open {
@@ -61,9 +61,7 @@ pub fn find_path(walkable: &HashSet<IVec2>, from: IVec2, to: IVec2) -> Option<Pa
open.push(Open(1, from, from, 0));
loop {
- let Some(Open(_, pos, f, distance)) = open.pop() else {
- return None;
- };
+ let Open(_, pos, f, distance) = open.pop()?;
if visited.contains_key(&pos) {
continue;
}