Skip to content

Commit 43e519d

Browse files
authored
Make ImageHash usable as key in std containers (#3321)
1 parent c9811ba commit 43e519d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/model/misc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::utils;
1616

1717
/// Hides the implementation detail of ImageHash as an enum.
1818
#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
19-
#[derive(Clone, Copy, PartialEq, Eq)]
19+
#[derive(Clone, Copy, Eq, Hash, Ord, PartialEq, PartialOrd)]
2020
enum ImageHashInner {
2121
Normal { hash: [u8; 16], is_animated: bool },
2222
Clyde,
@@ -36,7 +36,7 @@ enum ImageHashInner {
3636
/// ```
3737
3838
#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
39-
#[derive(Clone, Copy, PartialEq, Eq)]
39+
#[derive(Clone, Copy, Eq, Hash, Ord, PartialEq, PartialOrd)]
4040
pub struct ImageHash(ImageHashInner);
4141

4242
impl ImageHash {

0 commit comments

Comments
 (0)