Skip to content

Commit 8696cf3

Browse files
committed
Implement Ord and PartialOrd for AssetRef
1 parent ef7d5f2 commit 8696cf3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/asset.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,18 @@ impl Hash for AssetRef {
187187
}
188188
}
189189

190+
impl PartialOrd for AssetRef {
191+
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
192+
Some(self.cmp(other))
193+
}
194+
}
195+
196+
impl Ord for AssetRef {
197+
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
198+
self.id.unwrap().cmp(&other.id.unwrap())
199+
}
200+
}
201+
190202
/// A pool of [`Asset`]s
191203
pub struct AssetPool {
192204
/// The pool of active assets

0 commit comments

Comments
 (0)