1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

clippy warnings

This commit is contained in:
Nikolay Kim
2018-04-29 09:09:08 -07:00
parent d98d723f97
commit c72d1381a6
62 changed files with 1742 additions and 818 deletions

View File

@@ -142,8 +142,9 @@ impl Client {
U: IntoIterator<Item = V> + 'static,
V: AsRef<str>,
{
let mut protos =
protos.into_iter().fold(String::new(), |acc, s| acc + s.as_ref() + ",");
let mut protos = protos
.into_iter()
.fold(String::new(), |acc, s| acc + s.as_ref() + ",");
protos.pop();
self.protocols = Some(protos);
self
@@ -217,7 +218,8 @@ impl Client {
self.request.upgrade();
self.request.set_header(header::UPGRADE, "websocket");
self.request.set_header(header::CONNECTION, "upgrade");
self.request.set_header(header::SEC_WEBSOCKET_VERSION, "13");
self.request
.set_header(header::SEC_WEBSOCKET_VERSION, "13");
self.request.with_connector(self.conn.clone());
if let Some(protocols) = self.protocols.take() {
@@ -392,7 +394,10 @@ impl Future for ClientHandshake {
encoded,
key
);
return Err(ClientError::InvalidChallengeResponse(encoded, key.clone()));
return Err(ClientError::InvalidChallengeResponse(
encoded,
key.clone(),
));
}
} else {
trace!("Missing SEC-WEBSOCKET-ACCEPT header");
@@ -411,9 +416,7 @@ impl Future for ClientHandshake {
inner: Rc::clone(&inner),
max_size: self.max_size,
},
ClientWriter {
inner,
},
ClientWriter { inner },
)))
}
}
@@ -533,13 +536,23 @@ impl ClientWriter {
/// Send ping frame
#[inline]
pub fn ping(&mut self, message: &str) {
self.write(Frame::message(Vec::from(message), OpCode::Ping, true, true));
self.write(Frame::message(
Vec::from(message),
OpCode::Ping,
true,
true,
));
}
/// Send pong frame
#[inline]
pub fn pong(&mut self, message: &str) {
self.write(Frame::message(Vec::from(message), OpCode::Pong, true, true));
self.write(Frame::message(
Vec::from(message),
OpCode::Pong,
true,
true,
));
}
/// Send close frame