Fix unused warning for un-accessed enum variant field in net-tokio 2024-03-test-ci-beta-fail
authorMatt Corallo <git@bluematt.me>
Thu, 21 Mar 2024 15:53:00 +0000 (15:53 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 5 Apr 2024 09:05:56 +0000 (09:05 +0000)
lightning-net-tokio/src/lib.rs

index 41691d9a0798b87133b90d4d7cd7b713349bafed..71d63ecadcfa96e3b7fbd4a2c7c1076af2470e25 100644 (file)
@@ -208,7 +208,12 @@ impl Connection {
                                                break Disconnect::CloseConnection;
                                        }
                                },
-                               SelectorOutput::B(_) => {},
+                               SelectorOutput::B(some) => {
+                                       // The mpsc Receiver should only return `None` if the write side has been
+                                       // dropped, but that shouldn't be possible since its referenced by the Self in
+                                       // `us`.
+                                       debug_assert!(some.is_some());
+                               },
                                SelectorOutput::C(res) => {
                                        if res.is_err() { break Disconnect::PeerDisconnected; }
                                        match reader.try_read(&mut buf) {