diff --git a/edge-ws/README.md b/edge-ws/README.md index 7d1cf69..fba37ce 100644 --- a/edge-ws/README.md +++ b/edge-ws/README.md @@ -98,7 +98,7 @@ where for payload in ["Hello world!", "How are you?", "I'm fine, thanks!"] { let header = FrameHeader { frame_type: FrameType::Text(false), - payload_len: payload.as_bytes().len() as _, + payload_len: payload.len(), mask_key: rng_source.next_u32().into(), }; diff --git a/examples/ws_client.rs b/examples/ws_client.rs index c6f9d26..c82bd56 100644 --- a/examples/ws_client.rs +++ b/examples/ws_client.rs @@ -74,7 +74,7 @@ where for payload in ["Hello world!", "How are you?", "I'm fine, thanks!"] { let header = FrameHeader { frame_type: FrameType::Text(false), - payload_len: payload.as_bytes().len() as _, + payload_len: payload.len(), mask_key: rng_source.next_u32().into(), };