* The connect() function defined in this crate will automatically follow
redirecting responses.
* Adds Error::Redirection, which is a special case of Error::Http that
extracts the redirection target from the response headers, and stores it
in the error object. Client implementations that build upon tungstenite
can use this to implement redirecting.
* A catch-all solution for redirects is not possible due to the
abstraction transforming socket types to Read + Write, implementations
that use the client_* methods need to handle redirections themselves.
Suggested by clippy:
warning: use of `ok_or` followed by a function call
--> src/handshake/server.rs:20:19
|
20 | let key = self.headers.find_first("Sec-WebSocket-Key")
| ___________________^ starting here...
21 | | .ok_or(Error::Protocol("Missing Sec-WebSocket-Key".into()))?;
| |_______________________________________________________________________^ ...ending here
|
= note: #[warn(or_fun_call)] on by default
help: try this
| let key = self.headers.find_first("Sec-WebSocket-Key").ok_or_else(|| Error::Protocol("Missing Sec-WebSocket-Key".into()))?;
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#or_fun_call