Skip to content

Commit

Permalink
Fix clippy. (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuroitaki authored Nov 29, 2024
1 parent d974fb7 commit e6be5e1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions crates/tls/client/tests/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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>,
{
Expand All @@ -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>,
{
Expand Down
2 changes: 1 addition & 1 deletion crates/tls/core/src/msgs/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/tls/core/src/msgs/deframer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/tls/core/src/msgs/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion crates/tls/core/src/utils/bs_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e6be5e1

Please sign in to comment.