Skip to content

Commit

Permalink
fix: fix multicast stream boxing
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Nov 16, 2024
1 parent 7d5cc70 commit f4ab24e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/multicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use std::{pin::Pin, task::Poll};

use futures_util::Stream;
use futures_util::{Stream, stream::BoxStream};
use pin_project_lite::pin_project;
use thiserror::Error;

Expand All @@ -38,7 +38,7 @@ pin_project! {
#[project = VariantStreamProject]
enum VariantStream<'a> {
Twitch { #[pin] x: crate::twitch::Chat },
YouTube { #[pin] x: Pin<Box<dyn Stream<Item = Result<youtube::Action, youtube::Error>> + 'a>> }
YouTube { #[pin] x: BoxStream<'a, Result<youtube::Action, youtube::Error>> }
}
}

Expand All @@ -63,8 +63,8 @@ impl<'a> From<crate::twitch::Chat> for VariantStream<'a> {
}
}

impl<'a> From<Pin<Box<dyn Stream<Item = Result<youtube::Action, youtube::Error>> + 'a>>> for VariantStream<'a> {
fn from(value: Pin<Box<dyn Stream<Item = Result<youtube::Action, youtube::Error>> + 'a>>) -> Self {
impl<'a> From<BoxStream<'a, Result<youtube::Action, youtube::Error>>> for VariantStream<'a> {
fn from(value: BoxStream<'a, Result<youtube::Action, youtube::Error>>) -> Self {
Self::YouTube { x: value }
}
}
Expand Down

0 comments on commit f4ab24e

Please sign in to comment.