Skip to content

Commit

Permalink
Fixed rustfmt errors in StreamSubscribe
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Spencer <[email protected]>
  • Loading branch information
danrspencer committed Feb 16, 2023
1 parent 49dfc0c commit d4f30b1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions kube-runtime/src/utils/stream_subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ use core::{
};
use futures::{stream, Stream};
use pin_project::pin_project;
use std::fmt;
use std::sync::Arc;
use tokio::sync::broadcast;
use tokio::sync::broadcast::error::RecvError;
use std::{fmt, sync::Arc};
use tokio::sync::{broadcast, broadcast::error::RecvError};

const CHANNEL_CAPACITY: usize = 128;

Expand Down Expand Up @@ -40,7 +38,7 @@ impl<S: Stream> StreamSubscribe<S> {
/// Subscribe to events from this stream
#[must_use = "streams do nothing unless polled"]
pub fn subscribe(&self) -> impl Stream<Item = Result<Arc<S::Item>, Error>> {
stream::unfold(self.sender.subscribe(), |mut rx| async move {
stream::unfold(self.sender.subscribe(), |mut rx| async {
match rx.recv().await {
Ok(Some(obj)) => Some((Ok(obj), rx)),
Err(RecvError::Lagged(amt)) => Some((Err(Error::Lagged(amt)), rx)),
Expand Down

0 comments on commit d4f30b1

Please sign in to comment.