Fix clippy. (#666)

This commit is contained in:
yuroitaki
2024-11-30 00:33:22 +08:00
committed by GitHub
parent d974fb71d5
commit e6be5e1cc9
5 changed files with 8 additions and 8 deletions

View File

@@ -1009,7 +1009,7 @@ where
}
}
impl<'a, C, S> io::Read for ServerSession<'a, C, S>
impl<C, S> io::Read for ServerSession<'_, C, S>
where
C: DerefMut + Deref<Target = rustls::ConnectionCommon<S>>,
S: rustls::SideData,
@@ -1020,7 +1020,7 @@ where
}
}
impl<'a, C, S> io::Write for ServerSession<'a, C, S>
impl<C, S> io::Write for ServerSession<'_, C, S>
where
C: DerefMut + Deref<Target = rustls::ConnectionCommon<S>>,
S: rustls::SideData,
@@ -1103,7 +1103,7 @@ where
}
}
impl<'a, C> io::Read for ClientSession<'a, C>
impl<C> io::Read for ClientSession<'_, C>
where
C: DerefMut + Deref<Target = tls_client::ConnectionCommon>,
{
@@ -1113,7 +1113,7 @@ where
}
}
impl<'a, C> io::Write for ClientSession<'a, C>
impl<C> io::Write for ClientSession<'_, C>
where
C: DerefMut + Deref<Target = tls_client::ConnectionCommon>,
{

View File

@@ -6,7 +6,7 @@ pub struct Reader<'a> {
offs: usize,
}
impl<'a> Reader<'a> {
impl Reader<'_> {
pub fn init(bytes: &[u8]) -> Reader {
Reader {
buf: bytes,

View File

@@ -194,7 +194,7 @@ mod tests {
}
}
impl<'a> io::Read for ByteRead<'a> {
impl io::Read for ByteRead<'_> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
let mut len = 0;

View File

@@ -1008,7 +1008,7 @@ impl ClientHelloPayload {
pub fn check_psk_ext_is_last(&self) -> bool {
self.extensions
.last()
.map_or(false, |ext| ext.get_type() == ExtensionType::PreSharedKey)
.is_some_and(|ext| ext.get_type() == ExtensionType::PreSharedKey)
}
pub fn get_psk_modes(&self) -> Option<&PSKKeyExchangeModes> {

View File

@@ -12,7 +12,7 @@ use std::fmt;
/// `BsDebug` is not a part of public API of bytes crate.
pub(crate) struct BsDebug<'a>(pub(crate) &'a [u8]);
impl<'a> fmt::Debug for BsDebug<'a> {
impl fmt::Debug for BsDebug<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
write!(fmt, "b\"")?;
for &c in self.0 {