docs(liveview): fixed adapter comments
Fixed some typos; added some word capitalization, periods, and ``.
This commit is contained in:
4 files changed
+9
-9
No files matched your search
@@ -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<Message, warp::Error>) -> Result<Vec<u8>, 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();
|
||||
|
||||
Reference in new issue
Block a user