Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PartialEq to IggyError #1122

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading