Skip to content

Commit a4f4ff7

Browse files
authored
clippy: fixup rust 1.83 warnings (#1640)
* pkcs12: clippy fixups * crmf: clippy fixups * cms: clippy fixups * sec1: clippy fixups * pkcs1: clippy fixups * pkcs8: clippy fixups * x509-cert: clippy fixups * gss-api: clippy fixups * spki: clippy fixups * base64ct: clippy fixups * der: clippy fixups * pem-rfc7468: clippy fixups * const-oid: clippy fixups * serdect: clippy fixups * tls-codec: clippy fixups * const-oid: clippy fixup
1 parent 4a83301 commit a4f4ff7

File tree

33 files changed

+63
-63
lines changed

33 files changed

+63
-63
lines changed

base64ct/src/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl<'i, E: Encoding> Decoder<'i, E> {
253253
}
254254

255255
#[cfg(feature = "std")]
256-
impl<'i, E: Encoding> io::Read for Decoder<'i, E> {
256+
impl<E: Encoding> io::Read for Decoder<'_, E> {
257257
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
258258
if self.is_finished() {
259259
return Ok(0);
@@ -344,7 +344,7 @@ pub struct Line<'i> {
344344
remaining: &'i [u8],
345345
}
346346

347-
impl<'i> Default for Line<'i> {
347+
impl Default for Line<'_> {
348348
fn default() -> Self {
349349
Self::new(&[])
350350
}

base64ct/src/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<'o, E: Encoding> Encoder<'o, E> {
166166
}
167167

168168
#[cfg(feature = "std")]
169-
impl<'o, E: Encoding> io::Write for Encoder<'o, E> {
169+
impl<E: Encoding> io::Write for Encoder<'_, E> {
170170
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
171171
self.encode(buf)?;
172172
Ok(buf.len())

cms/src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl<'s> SignerInfoBuilder<'s> {
179179
}
180180
}
181181

182-
impl<'s> Builder for SignerInfoBuilder<'s> {
182+
impl Builder for SignerInfoBuilder<'_> {
183183
type Output = SignerInfo;
184184

185185
/// Calculate the data to be signed

const-oid/src/arcs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'a> Arcs<'a> {
111111
}
112112
}
113113

114-
impl<'a> Iterator for Arcs<'a> {
114+
impl Iterator for Arcs<'_> {
115115
type Item = Arc;
116116

117117
fn next(&mut self) -> Option<Arc> {

const-oid/src/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const fn base128_byte(arc: Arc, pos: usize, total: usize) -> Result<u8> {
132132
debug_assert!(pos < total);
133133
let last_byte = checked_add!(pos, 1) == total;
134134
let mask = if last_byte { 0 } else { 0b10000000 };
135-
let shift = checked_sub!(checked_sub!(total, pos), 1) * 7;
135+
let shift = checked_mul!(checked_sub!(checked_sub!(total, pos), 1), 7);
136136
Ok(((arc >> shift) & 0b1111111) as u8 | mask)
137137
}
138138

crmf/src/pop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl<'a> ::der::Decode<'a> for EncKeyWithIdChoice<'a> {
248248
}
249249
}
250250
}
251-
impl<'a> ::der::EncodeValue for EncKeyWithIdChoice<'a> {
251+
impl ::der::EncodeValue for EncKeyWithIdChoice<'_> {
252252
fn encode_value(&self, encoder: &mut impl ::der::Writer) -> ::der::Result<()> {
253253
match self {
254254
Self::String(variant) => variant.encode_value(encoder),

der/src/arrayvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<'a, T> Iterator for Iter<'a, T> {
125125
}
126126
}
127127

128-
impl<'a, T> ExactSizeIterator for Iter<'a, T> {}
128+
impl<T> ExactSizeIterator for Iter<'_, T> {}
129129

130130
#[cfg(test)]
131131
#[allow(clippy::unwrap_used)]

der/src/asn1/bit_string.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'a> TryFrom<BitStringRef<'a>> for &'a [u8] {
190190
}
191191
}
192192

193-
impl<'a> FixedTag for BitStringRef<'a> {
193+
impl FixedTag for BitStringRef<'_> {
194194
const TAG: Tag = Tag::BitString;
195195
}
196196

@@ -401,7 +401,7 @@ pub struct BitStringIter<'a> {
401401
position: usize,
402402
}
403403

404-
impl<'a> Iterator for BitStringIter<'a> {
404+
impl Iterator for BitStringIter<'_> {
405405
type Item = bool;
406406

407407
#[allow(clippy::arithmetic_side_effects)]
@@ -417,13 +417,13 @@ impl<'a> Iterator for BitStringIter<'a> {
417417
}
418418
}
419419

420-
impl<'a> ExactSizeIterator for BitStringIter<'a> {
420+
impl ExactSizeIterator for BitStringIter<'_> {
421421
fn len(&self) -> usize {
422422
self.bit_string.bit_len()
423423
}
424424
}
425425

426-
impl<'a> FusedIterator for BitStringIter<'a> {}
426+
impl FusedIterator for BitStringIter<'_> {}
427427

428428
#[cfg(feature = "flagset")]
429429
impl<T: flagset::Flags> FixedTag for flagset::FlagSet<T> {

der/src/asn1/context_specific.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl<'a, T> ContextSpecificRef<'a, T> {
234234
}
235235
}
236236

237-
impl<'a, T> EncodeValue for ContextSpecificRef<'a, T>
237+
impl<T> EncodeValue for ContextSpecificRef<'_, T>
238238
where
239239
T: EncodeValue + Tagged,
240240
{
@@ -247,7 +247,7 @@ where
247247
}
248248
}
249249

250-
impl<'a, T> Tagged for ContextSpecificRef<'a, T>
250+
impl<T> Tagged for ContextSpecificRef<'_, T>
251251
where
252252
T: Tagged,
253253
{

der/src/asn1/integer/int.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl<'a> DecodeValue<'a> for IntRef<'a> {
151151
}
152152
}
153153

154-
impl<'a> EncodeValue for IntRef<'a> {
154+
impl EncodeValue for IntRef<'_> {
155155
fn value_len(&self) -> Result<Length> {
156156
// Signed integers always hold their full encoded form.
157157
Ok(self.inner.len())
@@ -168,11 +168,11 @@ impl<'a> From<&IntRef<'a>> for IntRef<'a> {
168168
}
169169
}
170170

171-
impl<'a> FixedTag for IntRef<'a> {
171+
impl FixedTag for IntRef<'_> {
172172
const TAG: Tag = Tag::Integer;
173173
}
174174

175-
impl<'a> OrdIsValueOrd for IntRef<'a> {}
175+
impl OrdIsValueOrd for IntRef<'_> {}
176176

177177
#[cfg(feature = "alloc")]
178178
mod allocating {

0 commit comments

Comments
 (0)