Skip to content

Commit

Permalink
Merge branch 'fuse-abortable-oneshot'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Apr 3, 2024
2 parents e4b2ada + 26ff47b commit a9acdbb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mullvad-api/src/abortable_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//! immediately instead of after the socket times out.
use futures::channel::oneshot;
use futures::future::Fuse;
use futures::FutureExt;
use hyper::client::connect::{Connected, Connection};
use std::{
future::Future,
Expand Down Expand Up @@ -41,7 +43,7 @@ impl AbortableStreamHandle {

pub struct AbortableStream<S: Unpin> {
stream: S,
shutdown_rx: oneshot::Receiver<()>,
shutdown_rx: Fuse<oneshot::Receiver<()>>,
}

impl<S> AbortableStream<S>
Expand All @@ -56,7 +58,7 @@ where
(
Self {
stream,
shutdown_rx: rx,
shutdown_rx: rx.fuse(),
},
stream_handle,
)
Expand Down

0 comments on commit a9acdbb

Please sign in to comment.