Skip to content

Commit ad3f450

Browse files
authored
Merge pull request #117 from ericmcbride/allow-nonstatic-streams
Allow Non 'static items for use of async types
2 parents 2853bf9 + d9d2887 commit ad3f450

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/async.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl<T> Sender<T> {
9494
///
9595
/// In the current implementation, the returned future will not yield to the async runtime if the
9696
/// channel is unbounded. This may change in later versions.
97-
pub fn into_send_async(self, item: T) -> SendFut<'static, T> {
97+
pub fn into_send_async<'a>(self, item: T) -> SendFut<'a, T> {
9898
SendFut {
9999
sender: OwnedOrRef::Owned(self),
100100
hook: Some(SendState::NotYetSent(item)),
@@ -117,7 +117,7 @@ impl<T> Sender<T> {
117117
///
118118
/// In the current implementation, the returned sink will not yield to the async runtime if the
119119
/// channel is unbounded. This may change in later versions.
120-
pub fn into_sink(self) -> SendSink<'static, T> {
120+
pub fn into_sink<'a>(self) -> SendSink<'a, T> {
121121
SendSink(SendFut {
122122
sender: OwnedOrRef::Owned(self),
123123
hook: None,
@@ -318,7 +318,7 @@ impl<T> Receiver<T> {
318318
/// Convert this receiver into a future that asynchronously receives a single message from the
319319
/// channel, returning an error if all senders have been dropped. If the channel is empty, this
320320
/// future will yield to the async runtime.
321-
pub fn into_recv_async(self) -> RecvFut<'static, T> {
321+
pub fn into_recv_async<'a>(self) -> RecvFut<'a, T> {
322322
RecvFut::new(OwnedOrRef::Owned(self))
323323
}
324324

@@ -329,7 +329,7 @@ impl<T> Receiver<T> {
329329
}
330330

331331
/// Convert this receiver into a stream that allows asynchronously receiving messages from the channel.
332-
pub fn into_stream(self) -> RecvStream<'static, T> {
332+
pub fn into_stream<'a>(self) -> RecvStream<'a, T> {
333333
RecvStream(RecvFut::new(OwnedOrRef::Owned(self)))
334334
}
335335
}

0 commit comments

Comments
 (0)