Skip to content

Commit 0d37f0c

Browse files
ranileandoriyu
authored andcommitted
Fix feature soundness issues with gloo-net (#243)
* Fix feature soundness issues with gloo-net * fmt
1 parent bd8f52c commit 0d37f0c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crates/net/src/websocket/futures.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ impl WebSocket {
9898
/// The error returned is [`JsError`]. See the
9999
/// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket#exceptions_thrown)
100100
/// to learn more.
101+
///
102+
/// This function requires `json` features because protocols are parsed by `serde` into `JsValue`.
103+
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
104+
#[cfg(feature = "json")]
101105
pub fn open_with_protocols<S: AsRef<str> + serde::Serialize>(
102106
url: &str,
103107
protocols: &[S],

crates/net/src/websocket/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use gloo_utils::errors::JsError;
1111
use std::fmt;
1212

1313
/// Message sent to and received from WebSocket.
14-
#[derive(Debug, PartialEq, Clone)]
14+
#[derive(Debug, PartialEq, Eq, Clone)]
1515
pub enum Message {
1616
/// String message
1717
Text(String),

0 commit comments

Comments
 (0)