mirror of https://github.com/rwf2/Rocket.git
Make 'ws::Stream![]' mean 'ws::Stream!['static]'.
This is in line with the stream macros in Rocket core.
This commit is contained in:
parent
1d2cc257dc
commit
847e87d5c9
|
@ -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?;
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue