Skip to content

Commit 62b5009

Browse files
committed
chore: fix clippy warnings
1 parent 7ad91e6 commit 62b5009

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

cli/src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ impl Exec for RgbArgs {
591591
.pay(invoice, *method, params)
592592
.map_err(|err| err.to_string())?;
593593

594-
transfer.save(&out_file)?;
594+
transfer.save(out_file)?;
595595

596596
let ver = if *v2 { PsbtVer::V2 } else { PsbtVer::V0 };
597597
eprintln!("{}", serde_yaml::to_string(&psbt).unwrap());

psbt/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pub enum ExtractError {}
6565

6666
pub trait RgbPsbt {
6767
fn rgb_embed(&mut self, batch: Batch) -> Result<(), EmbedError>;
68+
#[allow(clippy::result_large_err)]
6869
fn rgb_commit(&mut self) -> Result<Fascia, CommitError>;
6970
fn rgb_extract(&self) -> Result<Fascia, ExtractError>;
7071
}

psbt/src/rgb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl RgbExt for Psbt {
258258
return Ok(Some(method));
259259
}
260260
}
261-
return Err(RgbPsbtError::InvalidCloseMethod(opid));
261+
Err(RgbPsbtError::InvalidCloseMethod(opid))
262262
}
263263

264264
fn push_rgb_transition(

src/pay.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ impl TransferParams {
140140
}
141141

142142
impl Runtime {
143+
#[allow(clippy::result_large_err)]
143144
pub fn pay(
144145
&mut self,
145146
invoice: &RgbInvoice,
@@ -152,6 +153,7 @@ impl Runtime {
152153
Ok((psbt, meta, transfer))
153154
}
154155

156+
#[allow(clippy::result_large_err)]
155157
pub fn construct_psbt(
156158
&mut self,
157159
invoice: &RgbInvoice,
@@ -166,7 +168,7 @@ impl Runtime {
166168
let operation = invoice
167169
.operation
168170
.as_ref()
169-
.or_else(|| iface.default_operation.as_ref())
171+
.or(iface.default_operation.as_ref())
170172
.ok_or(CompositionError::NoOperation)?;
171173
let assignment_name = invoice
172174
.assignment
@@ -229,13 +231,13 @@ impl Runtime {
229231
Beneficiary::BlindedSeal(_) => (None, none!()),
230232
};
231233
let batch =
232-
self.compose(&invoice, outputs, method, beneficiary_vout, |_, _, _| meta.change_vout)?;
234+
self.compose(invoice, outputs, method, beneficiary_vout, |_, _, _| meta.change_vout)?;
233235

234236
let methods = batch.close_method_set();
235237
if methods.has_tapret_first() {
236238
let output = psbt
237239
.outputs_mut()
238-
.find(|o| o.script.is_p2tr() && &o.script != &beneficiary_script)
240+
.find(|o| o.script.is_p2tr() && o.script != beneficiary_script)
239241
.ok_or(CompositionError::TapretRequired)?;
240242
output.set_tapret_host().expect("just created");
241243
}
@@ -248,6 +250,7 @@ impl Runtime {
248250
Ok((psbt, meta))
249251
}
250252

253+
#[allow(clippy::result_large_err)]
251254
pub fn transfer(
252255
&mut self,
253256
invoice: &RgbInvoice,

0 commit comments

Comments
 (0)