Skip to content

Commit

Permalink
Fix new clippy::use_self warnings
Browse files Browse the repository at this point in the history
Seems this has improved when the explicit lifetime bound is
the same as the one implied in `Self`.
  • Loading branch information
ctz committed Mar 25, 2024
1 parent fb6e70a commit ffd933a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rustls/src/client/client_conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ pub struct WriteEarlyData<'a> {
}

impl<'a> WriteEarlyData<'a> {
fn new(sess: &'a mut ClientConnection) -> WriteEarlyData<'a> {
fn new(sess: &'a mut ClientConnection) -> Self {
WriteEarlyData { sess }
}

Expand Down
2 changes: 1 addition & 1 deletion rustls/src/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl<'a> Writer<'a> {
///
/// This is not an external interface. Get one of these objects
/// from [`Connection::writer`].
pub(crate) fn new(sink: &'a mut dyn PlaintextSink) -> Writer<'a> {
pub(crate) fn new(sink: &'a mut dyn PlaintextSink) -> Self {
Writer { sink }
}
}
Expand Down
2 changes: 1 addition & 1 deletion rustls/src/msgs/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl<'a> LengthPrefixedBuffer<'a> {
///
/// After this, the body of the length-delimited structure should be appended to `LengthPrefixedBuffer::buf`.
/// The length header is corrected in `LengthPrefixedBuffer::drop`.
pub(crate) fn new(size_len: ListLength, buf: &'a mut Vec<u8>) -> LengthPrefixedBuffer<'a> {
pub(crate) fn new(size_len: ListLength, buf: &'a mut Vec<u8>) -> Self {
let len_offset = buf.len();
buf.extend(match size_len {
ListLength::U8 => &[0xff][..],
Expand Down
2 changes: 1 addition & 1 deletion rustls/src/webpki/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub struct ParsedCertificate<'a>(pub(crate) webpki::EndEntityCert<'a>);

impl<'a> TryFrom<&'a CertificateDer<'a>> for ParsedCertificate<'a> {
type Error = Error;
fn try_from(value: &'a CertificateDer<'a>) -> Result<ParsedCertificate<'a>, Self::Error> {
fn try_from(value: &'a CertificateDer<'a>) -> Result<Self, Self::Error> {
webpki::EndEntityCert::try_from(value)
.map_err(pki_error)
.map(ParsedCertificate)
Expand Down

0 comments on commit ffd933a

Please sign in to comment.