]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Use implicit returns from match expressions
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 16 May 2024 21:02:42 +0000 (16:02 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Tue, 11 Jun 2024 16:05:32 +0000 (11:05 -0500)
lightning/src/ln/channelmanager.rs

index 80b98b2b6f5bacaafb31739744ea1357d5a0e1c1..815c0b46003b840cf544d80c465255fad1f3aee0 100644 (file)
@@ -10272,8 +10272,8 @@ where
                                };
 
                                match response {
-                                       Ok(invoice) => return responder.respond(OffersMessage::Invoice(invoice)),
-                                       Err(error) => return responder.respond(OffersMessage::InvoiceError(error.into())),
+                                       Ok(invoice) => responder.respond(OffersMessage::Invoice(invoice)),
+                                       Err(error) => responder.respond(OffersMessage::InvoiceError(error.into())),
                                }
                        },
                        OffersMessage::Invoice(invoice) => {
@@ -10300,14 +10300,14 @@ where
                                                        self.logger,
                                                        "A response was generated, but there is no reply_path specified for sending the response."
                                                );
-                                               return ResponseInstruction::NoResponse;
+                                               ResponseInstruction::NoResponse
                                        }
-                                       _ => return ResponseInstruction::NoResponse,
+                                       _ => ResponseInstruction::NoResponse,
                                }
                        },
                        OffersMessage::InvoiceError(invoice_error) => {
                                log_trace!(self.logger, "Received invoice_error: {}", invoice_error);
-                               return ResponseInstruction::NoResponse;
+                               ResponseInstruction::NoResponse
                        },
                }
        }