From 847e87d5c98fad0c23746a4fd0b34a1238ef5e62 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Fri, 31 Mar 2023 08:34:45 -0700 Subject: [PATCH] Make 'ws::Stream![]' mean 'ws::Stream!['static]'. This is in line with the stream macros in Rocket core. --- examples/upgrade/src/main.rs | 2 +- examples/upgrade/src/ws.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/upgrade/src/main.rs b/examples/upgrade/src/main.rs index b23c2ca8..bb6b6617 100644 --- a/examples/upgrade/src/main.rs +++ b/examples/upgrade/src/main.rs @@ -17,7 +17,7 @@ fn echo_manual<'r>(ws: ws::WebSocket) -> ws::Channel<'r> { } #[get("/echo")] -fn echo_stream<'r>(ws: ws::WebSocket) -> ws::Stream!['r] { +fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] { ws::stream! { ws => for await message in ws { yield message?; diff --git a/examples/upgrade/src/ws.rs b/examples/upgrade/src/ws.rs index 48353186..a2758977 100644 --- a/examples/upgrade/src/ws.rs +++ b/examples/upgrade/src/ws.rs @@ -132,11 +132,12 @@ impl<'r, S> IoHandler for MessageStream<'r, S> #[macro_export] macro_rules! Stream { + () => (Stream!['static]); ($l:lifetime) => ( $crate::ws::MessageStream<$l, impl rocket::futures::Stream< Item = $crate::ws::Result<$crate::ws::Message> > + $l> - ) + ); } #[macro_export]