Skip to content

Commit

Permalink
Merge pull request #247 from snapview/clippy-fixes
Browse files Browse the repository at this point in the history
Fix newly introduced clippy warnings
  • Loading branch information
daniel-abramov authored Oct 20, 2021
2 parents d0b924c + 6c4d2ba commit 1bbb4ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn connect_with_config<Req: IntoClientRequest>(
Mode::Tls => 443,
});
let addrs = (host, port).to_socket_addrs()?;
let mut stream = connect_to_some(addrs.as_slice(), &request.uri())?;
let mut stream = connect_to_some(addrs.as_slice(), request.uri())?;
NoDelay::set_nodelay(&mut stream, true)?;

#[cfg(not(any(feature = "native-tls", feature = "__rustls-tls")))]
Expand Down
6 changes: 3 additions & 3 deletions src/handshake/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ fn create_parts<T>(request: &HttpRequest<T>) -> Result<Builder> {

/// Create a response for the request.
pub fn create_response(request: &Request) -> Result<Response> {
Ok(create_parts(&request)?.body(())?)
Ok(create_parts(request)?.body(())?)
}

/// Create a response for the request with a custom body.
pub fn create_response_with_body<T>(
request: &HttpRequest<T>,
generate_body: impl FnOnce() -> T,
) -> Result<HttpResponse<T>> {
Ok(create_parts(&request)?.body(generate_body())?)
Ok(create_parts(request)?.body(generate_body())?)
}

// Assumes that this is a valid response
Expand Down Expand Up @@ -263,7 +263,7 @@ impl<S: Read + Write, C: Callback> HandshakeRole for ServerHandshake<S, C> {
let resp = self.error_response.as_ref().unwrap();

let mut output = vec![];
write_response(&mut output, &resp)?;
write_response(&mut output, resp)?;

if let Some(body) = resp.body() {
output.extend_from_slice(body.as_bytes());
Expand Down

0 comments on commit 1bbb4ce

Please sign in to comment.