Skip to content

Commit

Permalink
Feature: impl PartialEq for Entry
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Mar 2, 2023
1 parent f28a0ef commit 50821c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openraft/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ impl<C: RaftTypeConfig> Default for Entry<C> {
}
}

impl<C: RaftTypeConfig> PartialEq for Entry<C>
where C::D: PartialEq
{
fn eq(&self, other: &Self) -> bool {
self.log_id == other.log_id && self.payload == other.payload
}
}

impl<C: RaftTypeConfig> AsRef<Entry<C>> for Entry<C> {
fn as_ref(&self) -> &Entry<C> {
self
Expand Down

0 comments on commit 50821c3

Please sign in to comment.