remove superfluous return
This commit is contained in:
parent
c0ce540da6
commit
5bd8f32a6a
|
@ -18,7 +18,7 @@ pub type WsSink = SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, tungsten
|
|||
pub type WsStream = SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>;
|
||||
|
||||
impl WebSocketBackend {
|
||||
pub async fn new(
|
||||
pub async fn connect(
|
||||
websocket_url: &str,
|
||||
) -> Result<(WsSink, WsStream), crate::errors::GatewayError> {
|
||||
let mut roots = rustls::RootCertStore::empty();
|
||||
|
|
|
@ -22,7 +22,8 @@ pub struct Gateway {
|
|||
impl Gateway {
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
pub async fn new(websocket_url: String) -> Result<GatewayHandle, GatewayError> {
|
||||
let (websocket_send, mut websocket_receive) = WebSocketBackend::new(&websocket_url).await?;
|
||||
let (websocket_send, mut websocket_receive) =
|
||||
WebSocketBackend::connect(&websocket_url).await?;
|
||||
|
||||
let shared_websocket_send = Arc::new(Mutex::new(websocket_send));
|
||||
|
||||
|
|
|
@ -38,6 +38,6 @@ impl GatewayMessage {
|
|||
/// Parses the message as a payload;
|
||||
/// Returns a result of deserializing
|
||||
pub fn payload(&self) -> Result<types::GatewayReceivePayload, serde_json::Error> {
|
||||
return serde_json::from_str(&self.0);
|
||||
serde_json::from_str(&self.0)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue