Skip to content

Commit 8f530e3

Browse files
committed
fmt and clippy
1 parent 591f870 commit 8f530e3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

worker/src/websocket.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl WebSocket {
6464
/// Response::error("never got a message echoed back :(", 500)
6565
/// ```
6666
pub async fn connect(url: Url) -> Result<WebSocket> {
67-
return WebSocket::connect_with_protocols(url, None).await;
67+
WebSocket::connect_with_protocols(url, None).await
6868
}
6969

7070
/// Attempts to establish a [`WebSocket`] connection to the provided [`Url`] and protocol.
@@ -74,7 +74,10 @@ impl WebSocket {
7474
/// let ws = WebSocket::connect_with_protocols("wss://echo.zeb.workers.dev/".parse()?, Some(vec!["GiggleBytes"])).await?;
7575
///
7676
/// ```
77-
pub async fn connect_with_protocols(mut url: Url, protocols: Option<Vec<&str>>) -> Result<WebSocket> {
77+
pub async fn connect_with_protocols(
78+
mut url: Url,
79+
protocols: Option<Vec<&str>>,
80+
) -> Result<WebSocket> {
7881
let scheme: String = match url.scheme() {
7982
"ws" => "http".into(),
8083
"wss" => "https".into(),
@@ -91,7 +94,8 @@ impl WebSocket {
9194
match protocols {
9295
None => {}
9396
Some(v) => {
94-
req.headers_mut()?.set("Sec-WebSocket-Protocol", v.join(",").as_str())?;
97+
req.headers_mut()?
98+
.set("Sec-WebSocket-Protocol", v.join(",").as_str())?;
9599
}
96100
}
97101

0 commit comments

Comments
 (0)