Skip to content

Commit 9426759

Browse files
committed
f remove 'let _ =' for state transitions
1 parent a48be53 commit 9426759

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lightning/src/ln/interactivetxs.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ macro_rules! define_state_transitions {
452452
impl<S: LocalState> StateTransition<ReceivedChange, $data> for S {
453453
fn transition(self, data: $data) -> StateTransitionResult<ReceivedChange> {
454454
let mut context = self.into_negotiation_context();
455-
let _ = context.$transition(data)?;
455+
context.$transition(data)?;
456456
Ok(ReceivedChange(context))
457457
}
458458
}
@@ -463,7 +463,7 @@ macro_rules! define_state_transitions {
463463
impl<S: RemoteState> StateTransition<SentChange, $data> for S {
464464
fn transition(self, data: $data) -> StateTransitionResult<SentChange> {
465465
let mut context = self.into_negotiation_context();
466-
let _ = context.$transition(data);
466+
context.$transition(data);
467467
Ok(SentChange(context))
468468
}
469469
}
@@ -702,7 +702,7 @@ impl InteractiveTxConstructor {
702702
prevtx_out: input.previous_output.vout,
703703
sequence: input.sequence.to_consensus_u32(),
704704
};
705-
let _ = do_state_transition!(self, sent_tx_add_input, &msg)?;
705+
do_state_transition!(self, sent_tx_add_input, &msg)?;
706706
Ok(InteractiveTxMessageSend::TxAddInput(msg))
707707
} else if let Some((serial_id, output)) = self.outputs_to_contribute.pop() {
708708
let msg = msgs::TxAddOutput {
@@ -711,47 +711,47 @@ impl InteractiveTxConstructor {
711711
sats: output.value,
712712
script: output.script_pubkey,
713713
};
714-
let _ = do_state_transition!(self, sent_tx_add_output, &msg)?;
714+
do_state_transition!(self, sent_tx_add_output, &msg)?;
715715
Ok(InteractiveTxMessageSend::TxAddOutput(msg))
716716
} else {
717717
let msg = msgs::TxComplete { channel_id: self.channel_id };
718-
let _ = do_state_transition!(self, sent_tx_complete, &msg)?;
718+
do_state_transition!(self, sent_tx_complete, &msg)?;
719719
Ok(InteractiveTxMessageSend::TxComplete(msg))
720720
}
721721
}
722722

723723
pub fn handle_tx_add_input(
724724
&mut self, msg: &msgs::TxAddInput,
725725
) -> Result<InteractiveTxMessageSend, AbortReason> {
726-
let _ = do_state_transition!(self, received_tx_add_input, msg)?;
726+
do_state_transition!(self, received_tx_add_input, msg)?;
727727
self.do_local_state_transition()
728728
}
729729

730730
pub fn handle_tx_remove_input(
731731
&mut self, msg: &msgs::TxRemoveInput,
732732
) -> Result<InteractiveTxMessageSend, AbortReason> {
733-
let _ = do_state_transition!(self, received_tx_remove_input, msg)?;
733+
do_state_transition!(self, received_tx_remove_input, msg)?;
734734
self.do_local_state_transition()
735735
}
736736

737737
pub fn handle_tx_add_output(
738738
&mut self, msg: &msgs::TxAddOutput,
739739
) -> Result<InteractiveTxMessageSend, AbortReason> {
740-
let _ = do_state_transition!(self, received_tx_add_output, msg)?;
740+
do_state_transition!(self, received_tx_add_output, msg)?;
741741
self.do_local_state_transition()
742742
}
743743

744744
pub fn handle_tx_remove_output(
745745
&mut self, msg: &msgs::TxRemoveOutput,
746746
) -> Result<InteractiveTxMessageSend, AbortReason> {
747-
let _ = do_state_transition!(self, received_tx_remove_output, msg)?;
747+
do_state_transition!(self, received_tx_remove_output, msg)?;
748748
self.do_local_state_transition()
749749
}
750750

751751
pub fn handle_tx_complete(
752752
&mut self, msg: &msgs::TxComplete,
753753
) -> Result<(Option<InteractiveTxMessageSend>, Option<Transaction>), AbortReason> {
754-
let _ = do_state_transition!(self, received_tx_complete, msg)?;
754+
do_state_transition!(self, received_tx_complete, msg)?;
755755
match &self.state_machine {
756756
StateMachine::ReceivedTxComplete(_) => {
757757
let msg_send = self.do_local_state_transition()?;

0 commit comments

Comments
 (0)