summaryrefslogtreecommitdiff
path: root/src/broadcast.rs
diff options
context:
space:
mode:
authorojacobson <ojacobson@noreply.codeberg.org>2025-05-30 21:13:52 +0200
committerojacobson <ojacobson@noreply.codeberg.org>2025-05-30 21:13:52 +0200
commit2273b6dce6cb650c0a72b71491421f198518bfb7 (patch)
treee75b1f755f393411130d624908faacd1ea9b2a66 /src/broadcast.rs
parent414de683b23d0c14a56934bc04f930301b369035 (diff)
parent2c70481b1f8e7d820f3e449885ec601b75ba23cf (diff)
Fix a couple of stray `clippy` lints.
The added suppression for `manual_ok_err` is a mixed choice; I'd prefer `r.ok()` in most senses, but `BroadcastStream` is still new enough that I wouldn't be entirely surprised if the Tokio team added new error variants, that we'd want to expressly handle. I do feel a bit better suppressing individual [`clippy::pedantic`][pedantic] lints; they're allow-by-default for this reason anyways, and I opted into them (see 452c8d0d9edb9894c108b6d577806c7c9d0071dd) knowing that not all of them would be perfectly appropriate. [pedantic]: https://doc.rust-lang.org/clippy/ Merges prop/missed-lints into main.
Diffstat (limited to 'src/broadcast.rs')
-rw-r--r--src/broadcast.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/broadcast.rs b/src/broadcast.rs
index 2792a18..174016e 100644
--- a/src/broadcast.rs
+++ b/src/broadcast.rs
@@ -51,6 +51,11 @@ where
let rx = self.sender().subscribe();
BroadcastStream::from(rx).scan((), |(), r| {
+ // The following could technically be `r.ok()`, and is exactly
+ // equivalent to it, but spelling out the match arms means we'll
+ // find out at compile time if new errors get added to
+ // `BroadcastStreamRecvError`.
+ #[allow(clippy::manual_ok_err)]
future::ready(match r {
Ok(event) => Some(event),
// Stop the stream here. This will disconnect SSE clients