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

proj: fix clippy 1.83 findings #91

Merged
merged 1 commit into from
Nov 28, 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
2 changes: 1 addition & 1 deletion examples/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async fn main() -> Result<(), Box<dyn StdError + Send + Sync + 'static>> {

let mut root_cert_store = rustls::RootCertStore::empty();
if let Some(cafile) = &options.cafile {
for cert in CertificateDer::pem_file_iter(&cafile)? {
for cert in CertificateDer::pem_file_iter(cafile)? {
root_cert_store.add(cert?)?;
}
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ where
}
}

impl<'a, IO: AsyncRead + AsyncWrite + Unpin, C, SD> AsyncRead for Stream<'a, IO, C>
impl<IO: AsyncRead + AsyncWrite + Unpin, C, SD> AsyncRead for Stream<'_, IO, C>
where
C: DerefMut + Deref<Target = ConnectionCommon<SD>>,
SD: SideData,
Expand Down Expand Up @@ -241,7 +241,7 @@ where
}
}

impl<'a, IO: AsyncRead + AsyncWrite + Unpin, C, SD> AsyncWrite for Stream<'a, IO, C>
impl<IO: AsyncRead + AsyncWrite + Unpin, C, SD> AsyncWrite for Stream<'_, IO, C>
where
C: DerefMut + Deref<Target = ConnectionCommon<SD>>,
SD: SideData,
Expand Down Expand Up @@ -350,7 +350,7 @@ pub struct SyncReadAdapter<'a, 'b, T> {
pub cx: &'a mut Context<'b>,
}

impl<'a, 'b, T: AsyncRead + Unpin> Read for SyncReadAdapter<'a, 'b, T> {
impl<T: AsyncRead + Unpin> Read for SyncReadAdapter<'_, '_, T> {
#[inline]
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
let mut buf = ReadBuf::new(buf);
Expand All @@ -371,7 +371,7 @@ pub struct SyncWriteAdapter<'a, 'b, T> {
pub cx: &'a mut Context<'b>,
}

impl<'a, 'b, T: Unpin> SyncWriteAdapter<'a, 'b, T> {
impl<T: Unpin> SyncWriteAdapter<'_, '_, T> {
#[inline]
fn poll_with<U>(
&mut self,
Expand All @@ -384,7 +384,7 @@ impl<'a, 'b, T: Unpin> SyncWriteAdapter<'a, 'b, T> {
}
}

impl<'a, 'b, T: AsyncWrite + Unpin> Write for SyncWriteAdapter<'a, 'b, T> {
impl<T: AsyncWrite + Unpin> Write for SyncWriteAdapter<'_, '_, T> {
#[inline]
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.poll_with(|io, cx| io.poll_write(cx, buf))
Expand Down
4 changes: 2 additions & 2 deletions src/common/test_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use super::Stream;

struct Good<'a>(&'a mut Connection);

impl<'a> AsyncRead for Good<'a> {
impl AsyncRead for Good<'_> {
fn poll_read(
mut self: Pin<&mut Self>,
_cx: &mut Context<'_>,
Expand All @@ -31,7 +31,7 @@ impl<'a> AsyncRead for Good<'a> {
}
}

impl<'a> AsyncWrite for Good<'a> {
impl AsyncWrite for Good<'_> {
fn poll_write(
mut self: Pin<&mut Self>,
_cx: &mut Context<'_>,
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mod utils {
let key = PrivateKeyDer::from_pem_slice(EE_KEY.as_bytes()).unwrap();
let sconfig = ServerConfig::builder()
.with_no_client_auth()
.with_single_cert(cert, key.into())
.with_single_cert(cert, key)
.unwrap();

let mut client_root_cert_store = RootCertStore::empty();
Expand Down