diff --git a/src/body.rs b/src/body.rs index d57dd32..047de1c 100644 --- a/src/body.rs +++ b/src/body.rs @@ -13,6 +13,12 @@ pub struct Body<'a> { _pin: std::marker::PhantomPinned, } +impl<'a> PartialEq> for Body<'a> { + fn eq(&self, other: &Self) -> bool { + self.elems == other.elems + } +} + impl Default for Body<'_> { fn default() -> Self { Body { diff --git a/src/value.rs b/src/value.rs index 0412b4e..dd47e1f 100644 --- a/src/value.rs +++ b/src/value.rs @@ -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), @@ -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,