diff --git a/packages/liveview/src/adapters/axum_adapter.rs b/packages/liveview/src/adapters/axum_adapter.rs index 8c6f5ce31..c4cf070ee 100644 --- a/packages/liveview/src/adapters/axum_adapter.rs +++ b/packages/liveview/src/adapters/axum_adapter.rs @@ -2,9 +2,9 @@ use crate::{LiveViewError, LiveViewSocket}; use axum::extract::ws::{Message, WebSocket}; use futures_util::{SinkExt, StreamExt}; -/// Convert a warp websocket into a LiveViewSocket +/// Convert an Axum WebSocket into a `LiveViewSocket`. /// -/// This is required to launch a LiveView app using the warp web framework +/// This is required to launch a LiveView app using the Axum web framework. pub fn axum_socket(ws: WebSocket) -> impl LiveViewSocket { ws.map(transform_rx) .with(transform_tx) diff --git a/packages/liveview/src/adapters/rocket_adapter.rs b/packages/liveview/src/adapters/rocket_adapter.rs index 8a9840bf2..f7feb1840 100644 --- a/packages/liveview/src/adapters/rocket_adapter.rs +++ b/packages/liveview/src/adapters/rocket_adapter.rs @@ -2,9 +2,9 @@ use crate::{LiveViewError, LiveViewSocket}; use rocket::futures::{SinkExt, StreamExt}; use rocket_ws::{result::Error, stream::DuplexStream, Message}; -/// Convert a rocket websocket into a LiveViewSocket +/// Convert a Rocket WebSocket into a `LiveViewSocket`. /// -/// This is required to launch a LiveView app using the rocket web framework +/// This is required to launch a LiveView app using the Rocket web framework. pub fn rocket_socket(stream: DuplexStream) -> impl LiveViewSocket { stream .map(transform_rx) diff --git a/packages/liveview/src/adapters/salvo_adapter.rs b/packages/liveview/src/adapters/salvo_adapter.rs index 138196da7..bd3e8a431 100644 --- a/packages/liveview/src/adapters/salvo_adapter.rs +++ b/packages/liveview/src/adapters/salvo_adapter.rs @@ -3,9 +3,9 @@ use salvo::ws::{Message, WebSocket}; use crate::{LiveViewError, LiveViewSocket}; -/// Convert a salvo websocket into a LiveViewSocket +/// Convert a Salvo WebSocket into a `LiveViewSocket`. /// -/// This is required to launch a LiveView app using the warp web framework +/// This is required to launch a LiveView app using the Salvo web framework. pub fn salvo_socket(ws: WebSocket) -> impl LiveViewSocket { ws.map(transform_rx) .with(transform_tx) diff --git a/packages/liveview/src/adapters/warp_adapter.rs b/packages/liveview/src/adapters/warp_adapter.rs index 9ee8c6fe4..dc7538b0f 100644 --- a/packages/liveview/src/adapters/warp_adapter.rs +++ b/packages/liveview/src/adapters/warp_adapter.rs @@ -2,9 +2,9 @@ use crate::{LiveViewError, LiveViewSocket}; use futures_util::{SinkExt, StreamExt}; use warp::ws::{Message, WebSocket}; -/// Convert a warp websocket into a LiveViewSocket +/// Convert a warp WebSocket into a `LiveViewSocket`. /// -/// This is required to launch a LiveView app using the warp web framework +/// This is required to launch a LiveView app using the warp web framework. pub fn warp_socket(ws: WebSocket) -> impl LiveViewSocket { ws.map(transform_rx) .with(transform_tx) @@ -12,7 +12,7 @@ pub fn warp_socket(ws: WebSocket) -> impl LiveViewSocket { } fn transform_rx(message: Result) -> Result, LiveViewError> { - // destructure the message into the buffer we got from warp + // Destructure the `message` into the buffer we got from warp. let msg = message .map_err(|_| LiveViewError::SendingFailed)? .into_bytes();