Skip to content

Commit 2d32653

Browse files
committed
der: impl Hash for SetOf
Fixes #1763
1 parent 58fb944 commit 2d32653

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

der/src/arrayvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use crate::{ErrorKind, Result};
66

77
/// Array-backed append-only vector type.
8-
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
8+
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
99
pub(crate) struct ArrayVec<T, const N: usize> {
1010
/// Elements of the set.
1111
elements: [Option<T>; N],

der/src/asn1/set_of.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use {alloc::vec::Vec, core::slice};
2525
/// and does not depend on `alloc` support.
2626
// TODO(tarcieri): use `ArrayVec` when/if it's merged into `core`
2727
// See: https://github.com/rust-lang/rfcs/pull/2990
28-
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
28+
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
2929
pub struct SetOf<T, const N: usize>
3030
where
3131
T: DerOrd,
@@ -200,7 +200,7 @@ impl<T> ExactSizeIterator for SetOfIter<'_, T> {}
200200
/// This type implements an append-only `SET OF` type which is heap-backed
201201
/// and depends on `alloc` support.
202202
#[cfg(feature = "alloc")]
203-
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
203+
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
204204
pub struct SetOfVec<T>
205205
where
206206
T: DerOrd,

0 commit comments

Comments
 (0)