Skip to content

Commit ffd933a

Browse files
committed
Fix new clippy::use_self warnings
Seems this has improved when the explicit lifetime bound is the same as the one implied in `Self`.
1 parent fb6e70a commit ffd933a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

rustls/src/client/client_conn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ pub struct WriteEarlyData<'a> {
495495
}
496496

497497
impl<'a> WriteEarlyData<'a> {
498-
fn new(sess: &'a mut ClientConnection) -> WriteEarlyData<'a> {
498+
fn new(sess: &'a mut ClientConnection) -> Self {
499499
WriteEarlyData { sess }
500500
}
501501

rustls/src/conn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<'a> Writer<'a> {
268268
///
269269
/// This is not an external interface. Get one of these objects
270270
/// from [`Connection::writer`].
271-
pub(crate) fn new(sink: &'a mut dyn PlaintextSink) -> Writer<'a> {
271+
pub(crate) fn new(sink: &'a mut dyn PlaintextSink) -> Self {
272272
Writer { sink }
273273
}
274274
}

rustls/src/msgs/codec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<'a> LengthPrefixedBuffer<'a> {
268268
///
269269
/// After this, the body of the length-delimited structure should be appended to `LengthPrefixedBuffer::buf`.
270270
/// The length header is corrected in `LengthPrefixedBuffer::drop`.
271-
pub(crate) fn new(size_len: ListLength, buf: &'a mut Vec<u8>) -> LengthPrefixedBuffer<'a> {
271+
pub(crate) fn new(size_len: ListLength, buf: &'a mut Vec<u8>) -> Self {
272272
let len_offset = buf.len();
273273
buf.extend(match size_len {
274274
ListLength::U8 => &[0xff][..],

rustls/src/webpki/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub struct ParsedCertificate<'a>(pub(crate) webpki::EndEntityCert<'a>);
119119

120120
impl<'a> TryFrom<&'a CertificateDer<'a>> for ParsedCertificate<'a> {
121121
type Error = Error;
122-
fn try_from(value: &'a CertificateDer<'a>) -> Result<ParsedCertificate<'a>, Self::Error> {
122+
fn try_from(value: &'a CertificateDer<'a>) -> Result<Self, Self::Error> {
123123
webpki::EndEntityCert::try_from(value)
124124
.map_err(pki_error)
125125
.map(ParsedCertificate)

0 commit comments

Comments
 (0)