refactor: must_use annotation for gossip::Builder

Not all use cases will involve sending messages (some will only want to
subscribe to messages) which might result in someone dropping the handle
they're not expecting to use.
pull/24376/head
Dom Dwyer 2023-08-02 12:59:47 +02:00
parent 117d70d807
commit adad6bb631
No known key found for this signature in database
GPG Key ID: E4C40DBD9157879A
1 changed files with 1 additions and 0 deletions

View File

@ -40,6 +40,7 @@ where
///
/// This call spawns a tokio task, and as such must be called from within a
/// tokio runtime.
#[must_use = "gossip reactor stops when handle drops"]
pub fn build(self, socket: UdpSocket) -> GossipHandle {
// Obtain a channel to communicate between the actor, and all handles
let (tx, rx) = mpsc::channel(1000);