mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Ord for Id (#5176)
This commit is contained in:
parent
87b6513df3
commit
d0c52d70fd
@ -99,6 +99,7 @@ Bottom level categories:
|
||||
-wgpu::Instance::any_backend_feature_enabled()
|
||||
+!wgpu::Instance::enabled_backend_features().is_empty()
|
||||
```
|
||||
- `wgpu::Id` now implements `PartialOrd`/`Ord` allowing it to be put in `BTreeMap`s. By @cwfitzgerald and @9291Sam in [#5176](https://github.com/gfx-rs/wgpu/pull/5176)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
@ -75,6 +75,7 @@ mod macros;
|
||||
use std::{
|
||||
any::Any,
|
||||
borrow::Cow,
|
||||
cmp::Ordering,
|
||||
error, fmt,
|
||||
future::Future,
|
||||
marker::PhantomData,
|
||||
@ -4971,6 +4972,18 @@ impl<T> PartialEq for Id<T> {
|
||||
|
||||
impl<T> Eq for Id<T> {}
|
||||
|
||||
impl<T> PartialOrd for Id<T> {
|
||||
fn partial_cmp(&self, other: &Id<T>) -> Option<Ordering> {
|
||||
self.0.partial_cmp(&other.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Ord for Id<T> {
|
||||
fn cmp(&self, other: &Id<T>) -> Ordering {
|
||||
self.0.cmp(&other.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> std::hash::Hash for Id<T> {
|
||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
self.0.hash(state)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user