Skip to content

Commit e41671e

Browse files
committed
fixes: use Box to fix large enum variant clippy error
1 parent 47e4e17 commit e41671e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/input.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use alloc::boxed::Box;
12
use alloc::sync::Arc;
23
use alloc::vec::Vec;
34
use core::fmt;
@@ -34,9 +35,9 @@ impl TxStatus {
3435

3536
#[derive(Debug, Clone)]
3637
enum PlanOrPsbtInput {
37-
Plan(Plan),
38+
Plan(Box<Plan>),
3839
PsbtInput {
39-
psbt_input: psbt::Input,
40+
psbt_input: Box<psbt::Input>,
4041
sequence: Sequence,
4142
absolute_timelock: absolute::LockTime,
4243
satisfaction_weight: usize,
@@ -57,7 +58,7 @@ impl PlanOrPsbtInput {
5758
return Err(FromPsbtInputError::UtxoCheck);
5859
}
5960
Ok(Self::PsbtInput {
60-
psbt_input,
61+
psbt_input: Box::new(psbt_input),
6162
sequence,
6263
absolute_timelock: absolute::LockTime::ZERO,
6364
satisfaction_weight,
@@ -216,7 +217,7 @@ impl Input {
216217
prev_outpoint: OutPoint::new(tx.compute_txid(), output_index as _),
217218
prev_txout: tx.tx_out(output_index).cloned()?,
218219
prev_tx: Some(tx),
219-
plan: PlanOrPsbtInput::Plan(plan),
220+
plan: PlanOrPsbtInput::Plan(Box::new(plan)),
220221
status,
221222
is_coinbase,
222223
})
@@ -234,7 +235,7 @@ impl Input {
234235
prev_outpoint,
235236
prev_txout,
236237
prev_tx: None,
237-
plan: PlanOrPsbtInput::Plan(plan),
238+
plan: PlanOrPsbtInput::Plan(Box::new(plan)),
238239
status,
239240
is_coinbase,
240241
}

src/output.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use alloc::boxed::Box;
12
use bitcoin::{Amount, ScriptBuf, TxOut};
23
use miniscript::bitcoin;
34

@@ -9,7 +10,7 @@ pub enum ScriptSource {
910
/// bitcoin script
1011
Script(ScriptBuf),
1112
/// definite descriptor
12-
Descriptor(DefiniteDescriptor),
13+
Descriptor(Box<DefiniteDescriptor>),
1314
}
1415

1516
impl From<ScriptBuf> for ScriptSource {
@@ -32,7 +33,7 @@ impl ScriptSource {
3233

3334
/// From descriptor
3435
pub fn from_descriptor(descriptor: DefiniteDescriptor) -> Self {
35-
Self::Descriptor(descriptor)
36+
Self::Descriptor(Box::new(descriptor))
3637
}
3738

3839
/// To ScriptBuf

0 commit comments

Comments
 (0)