Skip to content

Commit dcbe138

Browse files
authored
Merge pull request #2310 from alex/clipp-warnings
Resolve clippy warnings from nightly
2 parents 8d60e21 + 3060742 commit dcbe138

File tree

11 files changed

+37
-36
lines changed

11 files changed

+37
-36
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ jobs:
160160
- name: openssl
161161
version: 3.2.0
162162
- name: openssl
163+
old: true
163164
version: 1.1.1w
164165
- name: openssl
165166
version: 1.1.0l

openssl/src/asn1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl PartialEq<Asn1Time> for Asn1TimeRef {
247247
}
248248

249249
#[cfg(any(ossl102, boringssl))]
250-
impl<'a> PartialEq<Asn1Time> for &'a Asn1TimeRef {
250+
impl PartialEq<Asn1Time> for &Asn1TimeRef {
251251
fn eq(&self, other: &Asn1Time) -> bool {
252252
self.diff(other)
253253
.map(|t| t.days == 0 && t.secs == 0)
@@ -270,7 +270,7 @@ impl PartialOrd<Asn1Time> for Asn1TimeRef {
270270
}
271271

272272
#[cfg(any(ossl102, boringssl))]
273-
impl<'a> PartialOrd<Asn1Time> for &'a Asn1TimeRef {
273+
impl PartialOrd<Asn1Time> for &Asn1TimeRef {
274274
fn partial_cmp(&self, other: &Asn1Time) -> Option<Ordering> {
275275
self.compare(other).ok()
276276
}

openssl/src/bio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::util;
99

1010
pub struct MemBioSlice<'a>(*mut ffi::BIO, PhantomData<&'a [u8]>);
1111

12-
impl<'a> Drop for MemBioSlice<'a> {
12+
impl Drop for MemBioSlice<'_> {
1313
fn drop(&mut self) {
1414
unsafe {
1515
ffi::BIO_free_all(self.0);

openssl/src/bn.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ macro_rules! delegate {
12721272
};
12731273
}
12741274

1275-
impl<'a, 'b> Add<&'b BigNumRef> for &'a BigNumRef {
1275+
impl Add<&BigNumRef> for &BigNumRef {
12761276
type Output = BigNum;
12771277

12781278
fn add(self, oth: &BigNumRef) -> BigNum {
@@ -1284,7 +1284,7 @@ impl<'a, 'b> Add<&'b BigNumRef> for &'a BigNumRef {
12841284

12851285
delegate!(Add, add);
12861286

1287-
impl<'a, 'b> Sub<&'b BigNumRef> for &'a BigNumRef {
1287+
impl Sub<&BigNumRef> for &BigNumRef {
12881288
type Output = BigNum;
12891289

12901290
fn sub(self, oth: &BigNumRef) -> BigNum {
@@ -1296,7 +1296,7 @@ impl<'a, 'b> Sub<&'b BigNumRef> for &'a BigNumRef {
12961296

12971297
delegate!(Sub, sub);
12981298

1299-
impl<'a, 'b> Mul<&'b BigNumRef> for &'a BigNumRef {
1299+
impl Mul<&BigNumRef> for &BigNumRef {
13001300
type Output = BigNum;
13011301

13021302
fn mul(self, oth: &BigNumRef) -> BigNum {
@@ -1309,7 +1309,7 @@ impl<'a, 'b> Mul<&'b BigNumRef> for &'a BigNumRef {
13091309

13101310
delegate!(Mul, mul);
13111311

1312-
impl<'a, 'b> Div<&'b BigNumRef> for &'a BigNumRef {
1312+
impl<'b> Div<&'b BigNumRef> for &BigNumRef {
13131313
type Output = BigNum;
13141314

13151315
fn div(self, oth: &'b BigNumRef) -> BigNum {
@@ -1322,7 +1322,7 @@ impl<'a, 'b> Div<&'b BigNumRef> for &'a BigNumRef {
13221322

13231323
delegate!(Div, div);
13241324

1325-
impl<'a, 'b> Rem<&'b BigNumRef> for &'a BigNumRef {
1325+
impl<'b> Rem<&'b BigNumRef> for &BigNumRef {
13261326
type Output = BigNum;
13271327

13281328
fn rem(self, oth: &'b BigNumRef) -> BigNum {
@@ -1335,7 +1335,7 @@ impl<'a, 'b> Rem<&'b BigNumRef> for &'a BigNumRef {
13351335

13361336
delegate!(Rem, rem);
13371337

1338-
impl<'a> Shl<i32> for &'a BigNumRef {
1338+
impl Shl<i32> for &BigNumRef {
13391339
type Output = BigNum;
13401340

13411341
fn shl(self, n: i32) -> BigNum {
@@ -1345,15 +1345,15 @@ impl<'a> Shl<i32> for &'a BigNumRef {
13451345
}
13461346
}
13471347

1348-
impl<'a> Shl<i32> for &'a BigNum {
1348+
impl Shl<i32> for &BigNum {
13491349
type Output = BigNum;
13501350

13511351
fn shl(self, n: i32) -> BigNum {
13521352
self.deref().shl(n)
13531353
}
13541354
}
13551355

1356-
impl<'a> Shr<i32> for &'a BigNumRef {
1356+
impl Shr<i32> for &BigNumRef {
13571357
type Output = BigNum;
13581358

13591359
fn shr(self, n: i32) -> BigNum {
@@ -1363,23 +1363,23 @@ impl<'a> Shr<i32> for &'a BigNumRef {
13631363
}
13641364
}
13651365

1366-
impl<'a> Shr<i32> for &'a BigNum {
1366+
impl Shr<i32> for &BigNum {
13671367
type Output = BigNum;
13681368

13691369
fn shr(self, n: i32) -> BigNum {
13701370
self.deref().shr(n)
13711371
}
13721372
}
13731373

1374-
impl<'a> Neg for &'a BigNumRef {
1374+
impl Neg for &BigNumRef {
13751375
type Output = BigNum;
13761376

13771377
fn neg(self) -> BigNum {
13781378
self.to_owned().unwrap().neg()
13791379
}
13801380
}
13811381

1382-
impl<'a> Neg for &'a BigNum {
1382+
impl Neg for &BigNum {
13831383
type Output = BigNum;
13841384

13851385
fn neg(self) -> BigNum {

openssl/src/derive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ use openssl_macros::corresponds;
6161
/// A type used to derive a shared secret between two keys.
6262
pub struct Deriver<'a>(*mut ffi::EVP_PKEY_CTX, PhantomData<&'a ()>);
6363

64-
unsafe impl<'a> Sync for Deriver<'a> {}
65-
unsafe impl<'a> Send for Deriver<'a> {}
64+
unsafe impl Sync for Deriver<'_> {}
65+
unsafe impl Send for Deriver<'_> {}
6666

6767
#[allow(clippy::len_without_is_empty)]
6868
impl<'a> Deriver<'a> {
@@ -163,7 +163,7 @@ impl<'a> Deriver<'a> {
163163
}
164164
}
165165

166-
impl<'a> Drop for Deriver<'a> {
166+
impl Drop for Deriver<'_> {
167167
fn drop(&mut self) {
168168
unsafe {
169169
ffi::EVP_PKEY_CTX_free(self.0);

openssl/src/encrypt.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ pub struct Encrypter<'a> {
5656
_p: PhantomData<&'a ()>,
5757
}
5858

59-
unsafe impl<'a> Sync for Encrypter<'a> {}
60-
unsafe impl<'a> Send for Encrypter<'a> {}
59+
unsafe impl Sync for Encrypter<'_> {}
60+
unsafe impl Send for Encrypter<'_> {}
6161

62-
impl<'a> Drop for Encrypter<'a> {
62+
impl Drop for Encrypter<'_> {
6363
fn drop(&mut self) {
6464
unsafe {
6565
ffi::EVP_PKEY_CTX_free(self.pctx);
@@ -260,10 +260,10 @@ pub struct Decrypter<'a> {
260260
_p: PhantomData<&'a ()>,
261261
}
262262

263-
unsafe impl<'a> Sync for Decrypter<'a> {}
264-
unsafe impl<'a> Send for Decrypter<'a> {}
263+
unsafe impl Sync for Decrypter<'_> {}
264+
unsafe impl Send for Decrypter<'_> {}
265265

266-
impl<'a> Drop for Decrypter<'a> {
266+
impl Drop for Decrypter<'_> {
267267
fn drop(&mut self) {
268268
unsafe {
269269
ffi::EVP_PKEY_CTX_free(self.pctx);

openssl/src/ocsp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub struct OcspStatus<'a> {
122122
pub next_update: &'a Asn1GeneralizedTimeRef,
123123
}
124124

125-
impl<'a> OcspStatus<'a> {
125+
impl OcspStatus<'_> {
126126
/// Checks validity of the `this_update` and `next_update` fields.
127127
///
128128
/// The `nsec` parameter specifies an amount of slack time that will be used when comparing

openssl/src/sign.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ impl Signer<'_> {
365365
}
366366
}
367367

368-
impl<'a> Write for Signer<'a> {
368+
impl Write for Signer<'_> {
369369
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
370370
self.update(buf)?;
371371
Ok(buf.len())
@@ -384,10 +384,10 @@ pub struct Verifier<'a> {
384384
pkey_pd: PhantomData<&'a ()>,
385385
}
386386

387-
unsafe impl<'a> Sync for Verifier<'a> {}
388-
unsafe impl<'a> Send for Verifier<'a> {}
387+
unsafe impl Sync for Verifier<'_> {}
388+
unsafe impl Send for Verifier<'_> {}
389389

390-
impl<'a> Drop for Verifier<'a> {
390+
impl Drop for Verifier<'_> {
391391
fn drop(&mut self) {
392392
// pkey_ctx is owned by the md_ctx, so no need to explicitly free it.
393393
unsafe {
@@ -566,7 +566,7 @@ impl<'a> Verifier<'a> {
566566
}
567567
}
568568

569-
impl<'a> Write for Verifier<'a> {
569+
impl Write for Verifier<'_> {
570570
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
571571
self.update(buf)?;
572572
Ok(buf.len())

openssl/src/ssl/test/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,20 +1367,20 @@ fn stateless() {
13671367

13681368
pub struct Outgoing<'a>(&'a mut Vec<u8>);
13691369

1370-
impl<'a> Drop for Outgoing<'a> {
1370+
impl Drop for Outgoing<'_> {
13711371
fn drop(&mut self) {
13721372
self.0.clear();
13731373
}
13741374
}
13751375

1376-
impl<'a> ::std::ops::Deref for Outgoing<'a> {
1376+
impl ::std::ops::Deref for Outgoing<'_> {
13771377
type Target = [u8];
13781378
fn deref(&self) -> &[u8] {
13791379
self.0
13801380
}
13811381
}
13821382

1383-
impl<'a> AsRef<[u8]> for Outgoing<'a> {
1383+
impl AsRef<[u8]> for Outgoing<'_> {
13841384
fn as_ref(&self) -> &[u8] {
13851385
self.0
13861386
}

openssl/src/stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl<'a, T: Stackable> DoubleEndedIterator for Iter<'a, T> {
343343
}
344344
}
345345

346-
impl<'a, T: Stackable> ExactSizeIterator for Iter<'a, T> {}
346+
impl<T: Stackable> ExactSizeIterator for Iter<'_, T> {}
347347

348348
/// A mutable iterator over the stack's contents.
349349
pub struct IterMut<'a, T: Stackable> {
@@ -377,4 +377,4 @@ impl<'a, T: Stackable> DoubleEndedIterator for IterMut<'a, T> {
377377
}
378378
}
379379

380-
impl<'a, T: Stackable> ExactSizeIterator for IterMut<'a, T> {}
380+
impl<T: Stackable> ExactSizeIterator for IterMut<'_, T> {}

openssl/src/x509/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl X509StoreContextRef {
135135
{
136136
struct Cleanup<'a>(&'a mut X509StoreContextRef);
137137

138-
impl<'a> Drop for Cleanup<'a> {
138+
impl Drop for Cleanup<'_> {
139139
fn drop(&mut self) {
140140
unsafe {
141141
ffi::X509_STORE_CTX_cleanup(self.0.as_ptr());
@@ -873,7 +873,7 @@ impl Eq for X509 {}
873873
/// A context object required to construct certain `X509` extension values.
874874
pub struct X509v3Context<'a>(ffi::X509V3_CTX, PhantomData<(&'a X509Ref, &'a ConfRef)>);
875875

876-
impl<'a> X509v3Context<'a> {
876+
impl X509v3Context<'_> {
877877
pub fn as_ptr(&self) -> *mut ffi::X509V3_CTX {
878878
&self.0 as *const _ as *mut _
879879
}

0 commit comments

Comments
 (0)