Skip to content

Commit

Permalink
Remove redundant PartialEq implementation
Browse files Browse the repository at this point in the history
The `OhttpKeys` type is `Eq` so explicit impl can be replaced with
a derive macro.
  • Loading branch information
DanGould committed Jul 2, 2024
1 parent af92319 commit b7cf5e8
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions payjoin/src/send/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl<'a> RequestBuilder<'a> {
}
}

#[derive(Clone)]
#[derive(Clone, PartialEq)]
pub struct RequestContext {
psbt: Psbt,
endpoint: Url,
Expand All @@ -264,23 +264,6 @@ pub struct RequestContext {
e: bitcoin::secp256k1::SecretKey,
}

#[cfg(feature = "v2")]
impl PartialEq for RequestContext {
fn eq(&self, other: &Self) -> bool {
self.psbt == other.psbt
&& self.endpoint == other.endpoint
// KeyConfig is not yet PartialEq
&& self.ohttp_keys.as_ref().map(|cfg| cfg.encode().unwrap_or_default()) == other.ohttp_keys.as_ref().map(|cfg| cfg.encode().unwrap_or_default())
&& self.disable_output_substitution == other.disable_output_substitution
&& self.fee_contribution == other.fee_contribution
&& self.min_fee_rate == other.min_fee_rate
&& self.input_type == other.input_type
&& self.sequence == other.sequence
&& self.payee == other.payee
&& self.e == other.e
}
}

#[cfg(feature = "v2")]
impl Eq for RequestContext {}

Expand Down

0 comments on commit b7cf5e8

Please sign in to comment.