aboutsummaryrefslogtreecommitdiff
path: root/azalea/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2023-05-12 18:53:08 +0000
committermat <github@matdoes.dev>2023-05-12 18:53:08 +0000
commit80172e43640d2ec3c761611d2269d12a9abdd424 (patch)
treec752a88bdef16502474ca4b1eb5d90c9b4559fe6 /azalea/src
parente1e1063d15a97bf93ec6dd1a082f78b0c3191d1d (diff)
downloadazalea-drasl-80172e43640d2ec3c761611d2269d12a9abdd424.tar.xz
fix warnings
Diffstat (limited to 'azalea/src')
-rw-r--r--azalea/src/pathfinder/astar.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/azalea/src/pathfinder/astar.rs b/azalea/src/pathfinder/astar.rs
index 858e7720..65caf337 100644
--- a/azalea/src/pathfinder/astar.rs
+++ b/azalea/src/pathfinder/astar.rs
@@ -94,7 +94,7 @@ pub struct Edge<N: Eq + Hash + Copy, W: PartialOrd + Copy> {
pub cost: W,
}
-#[derive(PartialOrd, PartialEq)]
+#[derive(PartialEq)]
pub struct Weight<W: PartialOrd + Debug>(W);
impl<W: PartialOrd + Debug> Ord for Weight<W> {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
@@ -104,3 +104,8 @@ impl<W: PartialOrd + Debug> Ord for Weight<W> {
}
}
impl<W: PartialOrd + Debug> Eq for Weight<W> {}
+impl<W: PartialOrd + Debug> PartialOrd for Weight<W> {
+ fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
+ self.0.partial_cmp(&other.0)
+ }
+}