diff --git a/crates/yew-hooks/src/hooks/use_websocket.rs b/crates/yew-hooks/src/hooks/use_websocket.rs index d39a63f..ecf74fd 100644 --- a/crates/yew-hooks/src/hooks/use_websocket.rs +++ b/crates/yew-hooks/src/hooks/use_websocket.rs @@ -33,7 +33,7 @@ pub struct UseWebSocketOptions { /// `WebSocket` close callback. pub onclose: Option>, - /// Retry times. Defaults to 3, use `u32::MAX` for infinite retries. + /// Retry times. Defaults to `u32::MAX` for infinite retries. pub reconnect_limit: Option, /// Retry interval(ms). Defaults to 3000. pub reconnect_interval: Option, @@ -235,7 +235,7 @@ pub fn use_websocket_with_options(url: String, options: UseWebSocketOptions) -> let onmessage_bytes_ref = use_mut_latest(options.onmessage_bytes); let onerror_ref = use_mut_latest(options.onerror); let onclose_ref = use_mut_latest(options.onclose); - let reconnect_limit = options.reconnect_limit.unwrap_or(3); + let reconnect_limit = options.reconnect_limit.unwrap_or(u32::MAX); let reconnect_interval = options.reconnect_interval.unwrap_or(3 * 1000); let manual = options.manual.unwrap_or(false); let protocols = options.protocols; diff --git a/crates/yew-hooks/src/web_sys_ext.rs b/crates/yew-hooks/src/web_sys_ext.rs index f29fa64..237613c 100644 --- a/crates/yew-hooks/src/web_sys_ext.rs +++ b/crates/yew-hooks/src/web_sys_ext.rs @@ -3,6 +3,7 @@ //! which is inconvenient, so copy the binding code here for now. #![allow(unused_imports)] #![allow(clippy::unused_unit)] +#![allow(clippy::empty_docs)] use wasm_bindgen::{self, prelude::*}; use web_sys::{DataTransfer, DomRectReadOnly, Element, Event, EventTarget};