mirror of https://github.com/rwf2/Rocket.git
Fix contrib 'ws' README formatting.
This commit is contained in:
parent
c3520fb4a1
commit
db96f670b7
|
@ -21,15 +21,15 @@ This crate provides WebSocket support for Rocket via integration with Rocket's
|
||||||
|
|
||||||
2. Use it!
|
2. Use it!
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[get("/echo")]
|
#[get("/echo")]
|
||||||
fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] {
|
fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] {
|
||||||
ws::stream! { ws =>
|
ws::stream! { ws =>
|
||||||
for await message in ws {
|
for await message in ws {
|
||||||
yield message?;
|
yield message?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [crate docs] for full details.
|
See the [crate docs] for full details.
|
||||||
|
|
Loading…
Reference in New Issue