Skip to content

Commit

Permalink
compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
UkoeHB committed Oct 14, 2023
1 parent f61f321 commit f6ddaad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sha-1 = { version = "0.10.1", optional = true }
tokio-tungstenite = { version = "0.20.0", optional = true }

#tokio-tungstenite-wasm = { version = "0.2.0", optional = true }
tokio-tungstenite-wasm = { git = "https://github.com/UkoeHB/tokio-tungstenite-wasm", rev = "503cf12", optional = true }
tokio-tungstenite-wasm = { git = "https://github.com/UkoeHB/tokio-tungstenite-wasm", rev = "15e61e4", optional = true }

tokio-rustls = { version = "0.24.1", optional = true }
tokio-native-tls = { version = "0.3.1", optional = true }
Expand Down
8 changes: 7 additions & 1 deletion examples/chat-client-wasm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ impl ezsockets::ClientExt for Client {
}
}

#[cfg(target_family = "wasm")]
#[wasm_bindgen::prelude::wasm_bindgen(main)]
async fn main() -> Result<(), wasm_bindgen::JsValue> {
// setup tracing
Expand All @@ -41,7 +42,7 @@ async fn main() -> Result<(), wasm_bindgen::JsValue> {
heartbeat_ping_msg_fn: Arc::new(|_t: Duration| RawMessage::Binary("ping".into())),
..Default::default()
});
let (client, mut handle) = ezsockets::connect_with(
let (_client, mut handle) = ezsockets::connect_with(
|_client| Client {},
config,
ezsockets::ClientConnectorWasm::default(),
Expand All @@ -54,3 +55,8 @@ async fn main() -> Result<(), wasm_bindgen::JsValue> {

Ok(())
}

#[cfg(not(target_family = "wasm"))]
fn main() {
unreachable!()
}

0 comments on commit f6ddaad

Please sign in to comment.