Skip to content

Commit

Permalink
remove superfluous return
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecificProtagonist committed Nov 19, 2023
1 parent 487bcd5 commit d7ec422
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gateway/backend_tungstenite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/gateway/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion src/gateway/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit d7ec422

Please sign in to comment.