mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
Ord for Id (#5176)
This commit is contained in:
parent
e029858a18
commit
9ca3e936db
@ -63,6 +63,11 @@ Bottom level categories:
|
||||
|
||||
## v0.19.2 (2024-02-29)
|
||||
|
||||
### Added/New Features
|
||||
|
||||
#### General
|
||||
- `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
|
||||
|
||||
#### General
|
||||
|
@ -74,6 +74,7 @@ mod macros;
|
||||
use std::{
|
||||
any::Any,
|
||||
borrow::Cow,
|
||||
cmp::Ordering,
|
||||
error, fmt,
|
||||
future::Future,
|
||||
marker::PhantomData,
|
||||
@ -4948,6 +4949,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…
Reference in New Issue
Block a user