Skip to content

Commit

Permalink
Add PartialEq to IggyError (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
spetz committed Aug 11, 2024
1 parent 3e551ee commit 5ff2a13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iggy"
version = "0.6.2"
version = "0.6.3"
description = "Iggy is the persistent message streaming platform written in Rust, supporting QUIC, TCP and HTTP transport protocols, capable of processing millions of messages per second."
edition = "2021"
license = "MIT"
Expand Down
8 changes: 7 additions & 1 deletion sdk/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,20 @@ impl IggyError {
}
}

impl PartialEq for IggyError {
fn eq(&self, other: &Self) -> bool {
self.as_code() == other.as_code()
}
}

#[cfg(test)]
mod tests {
use super::*;

const GROUP_NAME_ERROR_CODE: u32 = 5005;

#[test]
fn derived_sdk_error_disciminant_keeps_codes() {
fn derived_sdk_error_discriminant_keeps_codes() {
assert_eq!(
GROUP_NAME_ERROR_CODE,
IggyError::InvalidConsumerGroupName.as_code()
Expand Down

0 comments on commit 5ff2a13

Please sign in to comment.