Skip to content

Commit e20e8c6

Browse files
committed
f remove 'let _ =' for state transitions
1 parent 4d56ff3 commit e20e8c6

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
@@ -456,7 +456,7 @@ macro_rules! define_state_transitions {
456456
impl<S: LocalState> StateTransition<ReceivedChange, $data> for S {
457457
fn transition(self, data: $data) -> StateTransitionResult<ReceivedChange> {
458458
let mut context = self.into_negotiation_context();
459-
let _ = context.$transition(data)?;
459+
context.$transition(data)?;
460460
Ok(ReceivedChange(context))
461461
}
462462
}
@@ -467,7 +467,7 @@ macro_rules! define_state_transitions {
467467
impl<S: RemoteState> StateTransition<SentChange, $data> for S {
468468
fn transition(self, data: $data) -> StateTransitionResult<SentChange> {
469469
let mut context = self.into_negotiation_context();
470-
let _ = context.$transition(data);
470+
context.$transition(data);
471471
Ok(SentChange(context))
472472
}
473473
}
@@ -706,7 +706,7 @@ impl InteractiveTxConstructor {
706706
prevtx_out: input.previous_output.vout,
707707
sequence: input.sequence.to_consensus_u32(),
708708
};
709-
let _ = do_state_transition!(self, sent_tx_add_input, &msg)?;
709+
do_state_transition!(self, sent_tx_add_input, &msg)?;
710710
Ok(InteractiveTxMessageSend::TxAddInput(msg))
711711
} else if let Some((serial_id, output)) = self.outputs_to_contribute.pop() {
712712
let msg = msgs::TxAddOutput {
@@ -715,47 +715,47 @@ impl InteractiveTxConstructor {
715715
sats: output.value,
716716
script: output.script_pubkey,
717717
};
718-
let _ = do_state_transition!(self, sent_tx_add_output, &msg)?;
718+
do_state_transition!(self, sent_tx_add_output, &msg)?;
719719
Ok(InteractiveTxMessageSend::TxAddOutput(msg))
720720
} else {
721721
let msg = msgs::TxComplete { channel_id: self.channel_id };
722-
let _ = do_state_transition!(self, sent_tx_complete, &msg)?;
722+
do_state_transition!(self, sent_tx_complete, &msg)?;
723723
Ok(InteractiveTxMessageSend::TxComplete(msg))
724724
}
725725
}
726726

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

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

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

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

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

0 commit comments

Comments
 (0)