Skip to content

Commit ab49e41

Browse files
committed
Make method time on trait impl explitit to help bindings generator
Associated types in C bindings is somewhat of a misnomer - we concretize each trait to a single struct. Thus, different trait implementations must still have the same type, which defeats the point of associated types. In this particular case, however, we can reasonably special-case the `Infallible` type, as an instance of it existing implies something has gone horribly wrong. In order to help our bindings code figure out how to do so when referencing a parent trait's associated type, we specify the explicit type in the implementation method signature.
1 parent 401d035 commit ab49e41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/peer_handler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl wire::CustomMessageReader for IgnoringMessageHandler {
101101
}
102102

103103
impl CustomMessageHandler for IgnoringMessageHandler {
104-
fn handle_custom_message(&self, _msg: Self::CustomMessage, _sender_node_id: &PublicKey) -> Result<(), LightningError> {
104+
fn handle_custom_message(&self, _msg: Infallible, _sender_node_id: &PublicKey) -> Result<(), LightningError> {
105105
// Since we always return `None` in the read the handle method should never be called.
106106
unreachable!();
107107
}

0 commit comments

Comments
 (0)