From fd31eb74c522f9b0809ac844ba753cf3768e645d Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 24 Feb 2018 07:36:50 +0300 Subject: [PATCH] better ergonomics for ws client --- src/ws/client.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ws/client.rs b/src/ws/client.rs index 1d34b864b..2d385239d 100644 --- a/src/ws/client.rs +++ b/src/ws/client.rs @@ -128,7 +128,7 @@ impl WsClient { } /// Set supported websocket protocols - pub fn protocols(&mut self, protos: U) -> &mut Self + pub fn protocols(mut self, protos: U) -> Self where U: IntoIterator + 'static, V: AsRef { @@ -140,13 +140,13 @@ impl WsClient { } /// Set cookie for handshake request - pub fn cookie<'c>(&mut self, cookie: Cookie<'c>) -> &mut Self { + pub fn cookie<'c>(mut self, cookie: Cookie<'c>) -> Self { self.request.cookie(cookie); self } /// Set request Origin - pub fn origin(&mut self, origin: V) -> &mut Self + pub fn origin(mut self, origin: V) -> Self where HeaderValue: HttpTryFrom { match HeaderValue::try_from(origin) { @@ -157,7 +157,7 @@ impl WsClient { } /// Set request header - pub fn header(&mut self, key: K, value: V) -> &mut Self + pub fn header(mut self, key: K, value: V) -> Self where HeaderName: HttpTryFrom, HeaderValue: HttpTryFrom { self.request.header(key, value);