From b7cf5e84d6ab9b7f6bb4c649150b8d7429312a5d Mon Sep 17 00:00:00 2001 From: DanGould Date: Tue, 25 Jun 2024 14:20:05 -0400 Subject: [PATCH] Remove redundant PartialEq implementation The `OhttpKeys` type is `Eq` so explicit impl can be replaced with a derive macro. --- payjoin/src/send/mod.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/payjoin/src/send/mod.rs b/payjoin/src/send/mod.rs index e175f831..1f247bfc 100644 --- a/payjoin/src/send/mod.rs +++ b/payjoin/src/send/mod.rs @@ -248,7 +248,7 @@ impl<'a> RequestBuilder<'a> { } } -#[derive(Clone)] +#[derive(Clone, PartialEq)] pub struct RequestContext { psbt: Psbt, endpoint: Url, @@ -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 {}