Skip to content

Commit 99c39a8

Browse files
committed
lift return
1 parent bd3f23b commit 99c39a8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/conn.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<T: EventMessage + Unpin> Stream for Connection<T> {
139139
}
140140

141141
// read from the ws
142-
match ready!(pin.ws.poll_next_unpin(cx)) {
142+
return match ready!(pin.ws.poll_next_unpin(cx)) {
143143
Some(Ok(WsMessage::Text(text))) => {
144144
let ready = match serde_json::from_str::<Message<T>>(&text) {
145145
Ok(msg) => {
@@ -154,21 +154,21 @@ impl<T: EventMessage + Unpin> Stream for Connection<T> {
154154
continue;
155155
}
156156
};
157-
return Poll::Ready(Some(ready));
157+
Poll::Ready(Some(ready))
158158
}
159-
Some(Ok(WsMessage::Close(_))) => return Poll::Ready(None),
159+
Some(Ok(WsMessage::Close(_))) => Poll::Ready(None),
160160
// ignore ping and pong
161161
Some(Ok(WsMessage::Ping(_))) | Some(Ok(WsMessage::Pong(_))) => {
162162
cx.waker().wake_by_ref();
163-
return Poll::Pending;
163+
Poll::Pending
164164
}
165-
Some(Ok(msg)) => return Poll::Ready(Some(Err(CdpError::UnexpectedWsMessage(msg)))),
166-
Some(Err(err)) => return Poll::Ready(Some(Err(CdpError::Ws(err)))),
165+
Some(Ok(msg)) => Poll::Ready(Some(Err(CdpError::UnexpectedWsMessage(msg)))),
166+
Some(Err(err)) => Poll::Ready(Some(Err(CdpError::Ws(err)))),
167167
None => {
168168
// ws connection closed
169-
return Poll::Ready(None);
169+
Poll::Ready(None)
170170
}
171-
}
171+
};
172172
}
173173
}
174174
}

0 commit comments

Comments
 (0)