Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Crayon-Shin-chan-bitlightlabs committed Jan 15, 2025
1 parent b08fdfa commit b876098
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
24 changes: 12 additions & 12 deletions src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ pub struct WalletOutpointsFilter<'a, K, D: DescriptorRgb<K>, L2: Layer2>(pub &'a

// We need manual derivation to ensure we can be copied and cloned even if descriptor is not
// copyable/clonable.
impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> Copy for WalletOutpointsFilter<'a, K, D, L2> {}
impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> Clone for WalletOutpointsFilter<'a, K, D, L2> {
impl<K, D: DescriptorRgb<K>, L2: Layer2> Copy for WalletOutpointsFilter<'_, K, D, L2> {}
impl<K, D: DescriptorRgb<K>, L2: Layer2> Clone for WalletOutpointsFilter<'_, K, D, L2> {
fn clone(&self) -> Self { *self }
}

impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> AssignmentsFilter
for WalletOutpointsFilter<'a, K, D, L2>
impl<K, D: DescriptorRgb<K>, L2: Layer2> AssignmentsFilter
for WalletOutpointsFilter<'_, K, D, L2>
{
fn should_include(&self, output: impl Into<XOutpoint>, _: Option<XWitnessId>) -> bool {
match output.into().into_bp() {
Expand All @@ -49,13 +49,13 @@ pub struct WalletUnspentFilter<'a, K, D: DescriptorRgb<K>, L2: Layer2>(pub &'a W

// We need manual derivation to ensure we can be copied and cloned even if descriptor is not
// copyable/clonable.
impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> Copy for WalletUnspentFilter<'a, K, D, L2> {}
impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> Clone for WalletUnspentFilter<'a, K, D, L2> {
impl<K, D: DescriptorRgb<K>, L2: Layer2> Copy for WalletUnspentFilter<'_, K, D, L2> {}
impl<K, D: DescriptorRgb<K>, L2: Layer2> Clone for WalletUnspentFilter<'_, K, D, L2> {
fn clone(&self) -> Self { *self }
}

impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> AssignmentsFilter
for WalletUnspentFilter<'a, K, D, L2>
impl<K, D: DescriptorRgb<K>, L2: Layer2> AssignmentsFilter
for WalletUnspentFilter<'_, K, D, L2>
{
fn should_include(&self, output: impl Into<XOutpoint>, _: Option<XWitnessId>) -> bool {
match output.into().into_bp() {
Expand All @@ -69,13 +69,13 @@ pub struct WalletWitnessFilter<'a, K, D: DescriptorRgb<K>, L2: Layer2>(pub &'a W

// We need manual derivation to ensure we can be copied and cloned even if descriptor is not
// copyable/clonable.
impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> Copy for WalletWitnessFilter<'a, K, D, L2> {}
impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> Clone for WalletWitnessFilter<'a, K, D, L2> {
impl<K, D: DescriptorRgb<K>, L2: Layer2> Copy for WalletWitnessFilter<'_, K, D, L2> {}
impl<K, D: DescriptorRgb<K>, L2: Layer2> Clone for WalletWitnessFilter<'_, K, D, L2> {
fn clone(&self) -> Self { *self }
}

impl<'a, K, D: DescriptorRgb<K>, L2: Layer2> AssignmentsFilter
for WalletWitnessFilter<'a, K, D, L2>
impl<K, D: DescriptorRgb<K>, L2: Layer2> AssignmentsFilter
for WalletWitnessFilter<'_, K, D, L2>
{
fn should_include(&self, _: impl Into<XOutpoint>, witness_id: Option<XWitnessId>) -> bool {
self.0
Expand Down
4 changes: 1 addition & 3 deletions src/pay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ struct ContractOutpointsFilter<
}

impl<
'stock,
'wallet,
W: WalletProvider<K, L2> + ?Sized,
K,
S: StashProvider,
H: StateProvider,
P: IndexProvider,
L2: Layer2,
> AssignmentsFilter for ContractOutpointsFilter<'stock, 'wallet, W, K, S, H, P, L2>
> AssignmentsFilter for ContractOutpointsFilter<'_, '_, W, K, S, H, P, L2>
where W::Descr: DescriptorRgb<K>
{
fn should_include(&self, output: impl Into<XOutpoint>, id: Option<XWitnessId>) -> bool {
Expand Down

0 comments on commit b876098

Please sign in to comment.