Skip to content

Commit

Permalink
implement Eq and Hash for AeronError
Browse files Browse the repository at this point in the history
  • Loading branch information
KiriosK committed Feb 11, 2021
1 parent da0d97e commit 18f9fec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/utils/errors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

use std::hash::{Hash, Hasher};
use std::io;

use thiserror::Error;
Expand Down Expand Up @@ -75,6 +76,17 @@ impl PartialEq for AeronError {
}
}

impl Eq for AeronError {}

impl Hash for AeronError {
fn hash<H: Hasher>(&self, state: &mut H) {
match self {
AeronError::MemMappedFileError(err) => err.kind().hash(state),
err => err.hash(state),
}
}
}

#[repr(C)]
#[derive(Debug)]
pub enum AeronErrorCode {
Expand Down

0 comments on commit 18f9fec

Please sign in to comment.