fix clippy errors

This commit is contained in:
edouard 2022-11-04 16:22:32 +01:00
parent 063786fe54
commit a043f024e2
6 changed files with 14 additions and 16 deletions

View File

@ -144,10 +144,10 @@ impl State for CreateSpendPanel {
}
}
if matches!(message, Message::View(view::Message::Previous)) {
if self.steps.get(self.current - 1).is_some() {
self.current -= 1;
}
if matches!(message, Message::View(view::Message::Previous))
&& self.steps.get(self.current - 1).is_some()
{
self.current -= 1;
}
if let Some(step) = self.steps.get_mut(self.current) {

View File

@ -60,8 +60,8 @@ impl Step for ChooseRecipients {
_draft: &TransactionDraft,
message: Message,
) -> Command<Message> {
match message {
Message::View(view::Message::CreateSpend(msg)) => match &msg {
if let Message::View(view::Message::CreateSpend(msg)) = message {
match &msg {
view::CreateSpendMessage::AddRecipient => {
self.recipients.push(Recipient::default());
}
@ -72,8 +72,7 @@ impl Step for ChooseRecipients {
self.recipients.get_mut(*i).unwrap().update(msg);
}
_ => {}
},
_ => {}
}
}
Command::none()
}

View File

@ -37,7 +37,6 @@ pub fn spend_view<'a, T: Into<Element<'a, Message>>>(
.push(spend_overview_view(tx))
.push(action),
)
.into()
}
pub fn save_action<'a>(saved: bool) -> Element<'a, Message> {

View File

@ -21,10 +21,10 @@ use crate::{
},
};
pub fn choose_recipients_view<'a>(
recipients: Vec<Element<'a, Message>>,
pub fn choose_recipients_view(
recipients: Vec<Element<Message>>,
is_valid: bool,
) -> Element<'a, Message> {
) -> Element<Message> {
modal(
false,
None,

View File

@ -136,14 +136,14 @@ impl Daemon for EmbeddedDaemon {
}
fn delete_spend_tx(&self, txid: &Txid) -> Result<(), DaemonError> {
Ok(self
.handle
self.handle
.as_ref()
.ok_or(DaemonError::NoAnswer)?
.lock()
.unwrap()
.control
.delete_spend(txid))
.delete_spend(txid);
Ok(())
}
fn broadcast_spend_tx(&self, txid: &Txid) -> Result<(), DaemonError> {

View File

@ -71,7 +71,7 @@ pub trait Daemon: Debug {
.iter()
.any(|input| input.previous_output == coin.outpoint)
})
.map(|c| c.clone())
.copied()
.collect();
model::SpendTx::new(tx.psbt, tx.change_index.map(|i| i as usize), coins)
})