Fix ping (#284)
* fix: create document crash * chore: fix ping * chore: clippy
This commit is contained in:
parent
c1b797a2c4
commit
0875329a43
|
|
@ -153,6 +153,7 @@ impl WSClientHttpSender for Client {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(nathan): spawn for wasm
|
||||
pub fn platform_spawn<T>(future: T) -> tokio::task::JoinHandle<T::Output>
|
||||
where
|
||||
T: Future + Send + 'static,
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ impl Message {
|
|||
|
||||
/// Indicates whether a message is a ping message.
|
||||
pub fn is_ping(&self) -> bool {
|
||||
false
|
||||
matches!(self, Message::Ping(_))
|
||||
}
|
||||
|
||||
/// Indicates whether a message is a pong message.
|
||||
pub fn is_pong(&self) -> bool {
|
||||
false
|
||||
matches!(self, Message::Pong(_))
|
||||
}
|
||||
|
||||
/// Indicates whether a message ia s close message.
|
||||
|
|
|
|||
|
|
@ -80,7 +80,9 @@ fn to_fut_message(msg: Result<Message>) -> FutMessage {
|
|||
Message::Text(inner) => Ok(crate::Message::Text(inner)),
|
||||
Message::Binary(inner) => Ok(crate::Message::Binary(inner)),
|
||||
Message::Close(inner) => Ok(crate::Message::Close(inner.map(Into::into))),
|
||||
Message::Ping(_) | Message::Pong(_) | Message::Frame(_) => return None,
|
||||
Message::Pong(inner) => Ok(crate::Message::Pong(inner)),
|
||||
Message::Ping(inner) => Ok(crate::Message::Ping(inner)),
|
||||
Message::Frame(_) => return None,
|
||||
},
|
||||
Err(err) => Err(crate::Error::from(err)),
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue