remove superfluous return

This commit is contained in:
Vincent Junge 2023-11-19 17:46:49 +01:00
parent c0ce540da6
commit 5bd8f32a6a
3 changed files with 4 additions and 3 deletions

View File

@ -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();

View File

@ -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));

View File

@ -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)
}
}