Skip to content

Commit

Permalink
Implement some missing PartialEq
Browse files Browse the repository at this point in the history
  • Loading branch information
hillu committed Jan 22, 2025
1 parent e5fe58c commit 6a15844
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ pub struct Body<'a> {
_pin: std::marker::PhantomPinned,
}

impl<'a> PartialEq<Body<'a>> for Body<'a> {
fn eq(&self, other: &Self) -> bool {
self.elems == other.elems
}
}

impl Default for Body<'_> {
fn default() -> Self {
Body {
Expand Down
4 changes: 2 additions & 2 deletions src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum Quote {
Braces,
}

#[derive(Clone)]
#[derive(Clone, PartialEq)]
/// [`Value`]s parsed as hexadecimal, decimal, or octal numbers
pub enum Number {
Hex(u64),
Expand Down Expand Up @@ -54,7 +54,7 @@ impl Serialize for Number {
}

/// Representation of the value part of key/value pairs in [`Body`]
#[derive(Clone)]
#[derive(Clone, PartialEq)]
pub enum Value<'a> {
/// Empty value.
Empty,
Expand Down

0 comments on commit 6a15844

Please sign in to comment.