From f66785888bf8e80ddf4886f1f540629b456f2a2a Mon Sep 17 00:00:00 2001 From: mcc Date: Sun, 12 Jul 2026 16:11:15 -0400 Subject: [PATCH] Change misleading question marks to slashes in rocket_ws example-- the Rocket route macros often put "magic" after the ?, so I assumed copying it was required and wrote nonworking code --- contrib/ws/src/lib.rs | 8 ++++---- contrib/ws/src/websocket.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/ws/src/lib.rs b/contrib/ws/src/lib.rs index e3d63ef0af..bd2c350498 100644 --- a/contrib/ws/src/lib.rs +++ b/contrib/ws/src/lib.rs @@ -15,13 +15,13 @@ //! //! Then, use [`WebSocket`] as a request guard in any route and either call //! [`WebSocket::channel()`] or return a stream via [`Stream!`] or -//! [`WebSocket::stream()`] in the handler. The examples below are equivalent: +//! [`WebSocket::stream()`] in the handler. The endpoints in the example below are equivalent: //! //! ```rust //! # use rocket::get; //! # use rocket_ws as ws; //! # -//! #[get("/echo?channel")] +//! #[get("/echo/channel")] //! fn echo_channel(ws: ws::WebSocket) -> ws::Channel<'static> { //! use rocket::futures::{SinkExt, StreamExt}; //! @@ -34,7 +34,7 @@ //! })) //! } //! -//! #[get("/echo?stream")] +//! #[get("/echo/stream")] //! fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] { //! ws::Stream! { ws => //! for await message in ws { @@ -43,7 +43,7 @@ //! } //! } //! -//! #[get("/echo?compose")] +//! #[get("/echo/compose")] //! fn echo_compose(ws: ws::WebSocket) -> ws::Stream!['static] { //! ws.stream(|io| io) //! } diff --git a/contrib/ws/src/websocket.rs b/contrib/ws/src/websocket.rs index 361550441e..e3c0d6d6de 100644 --- a/contrib/ws/src/websocket.rs +++ b/contrib/ws/src/websocket.rs @@ -134,7 +134,7 @@ impl WebSocket { /// # use rocket_ws as ws; /// /// // Use `Stream!`, which internally calls `WebSocket::stream()`. - /// #[get("/echo?stream")] + /// #[get("/echo/stream")] /// fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] { /// ws::Stream! { ws => /// for await message in ws { @@ -144,7 +144,7 @@ impl WebSocket { /// } /// /// // Use a raw stream. - /// #[get("/echo?compose")] + /// #[get("/echo/compose")] /// fn echo_compose(ws: ws::WebSocket) -> ws::Stream!['static] { /// ws.stream(|io| io) /// }