Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve clippy issues #458

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ pub trait IntoClientRequest {
fn into_client_request(self) -> Result<Request>;
}

impl<'a> IntoClientRequest for &'a str {
impl IntoClientRequest for &str {
fn into_client_request(self) -> Result<Request> {
self.parse::<Uri>()?.into_client_request()
}
}

impl<'a> IntoClientRequest for &'a String {
impl IntoClientRequest for &String {
fn into_client_request(self) -> Result<Request> {
<&str as IntoClientRequest>::into_client_request(self)
}
Expand All @@ -214,7 +214,7 @@ impl IntoClientRequest for String {
}
}

impl<'a> IntoClientRequest for &'a Uri {
impl IntoClientRequest for &Uri {
fn into_client_request(self) -> Result<Request> {
self.clone().into_client_request()
}
Expand Down Expand Up @@ -246,7 +246,7 @@ impl IntoClientRequest for Uri {
}

#[cfg(feature = "url")]
impl<'a> IntoClientRequest for &'a url::Url {
impl IntoClientRequest for &url::Url {
fn into_client_request(self) -> Result<Request> {
self.as_str().into_client_request()
}
Expand All @@ -265,7 +265,7 @@ impl IntoClientRequest for Request {
}
}

impl<'h, 'b> IntoClientRequest for httparse::Request<'h, 'b> {
impl IntoClientRequest for httparse::Request<'_, '_> {
fn into_client_request(self) -> Result<Request> {
use crate::handshake::headers::FromHttparse;
Request::from_httparse(self)
Expand Down
6 changes: 3 additions & 3 deletions src/protocol/frame/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ pub struct CloseFrame<'t> {
pub reason: Cow<'t, str>,
}

impl<'t> CloseFrame<'t> {
impl CloseFrame<'_> {
/// Convert into a owned string.
pub fn into_owned(self) -> CloseFrame<'static> {
CloseFrame { code: self.code, reason: self.reason.into_owned().into() }
}
}

impl<'t> fmt::Display for CloseFrame<'t> {
impl fmt::Display for CloseFrame<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{} ({})", self.reason, self.code)
}
Expand Down Expand Up @@ -343,7 +343,7 @@ impl Frame {
#[inline]
pub fn close(msg: Option<CloseFrame>) -> Frame {
let payload = if let Some(CloseFrame { code, reason }) = msg {
let mut p = Vec::with_capacity(reason.as_bytes().len() + 2);
let mut p = Vec::with_capacity(reason.len() + 2);
p.extend(u16::from(code).to_be_bytes());
p.extend_from_slice(reason.as_bytes());
p
Expand Down
2 changes: 1 addition & 1 deletion src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<S: Read + Write + Debug> Debug for MaybeTlsStream<S> {
&'a rustls::StreamOwned<rustls::ClientConnection, S>,
);

impl<'a, S: Read + Write + Debug> Debug for RustlsStreamDebug<'a, S> {
impl<S: Read + Write + Debug> Debug for RustlsStreamDebug<'_, S> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("StreamOwned")
.field("conn", &self.0.conn)
Expand Down
Loading