Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve clippy warnings from nightly #477

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl<'a> Asn1Readable<'a> for Tlv<'a> {
true
}
}
impl<'a> Asn1Writable for Tlv<'a> {
impl Asn1Writable for Tlv<'_> {
#[inline]
fn write(&self, w: &mut Writer<'_>) -> WriteResult {
w.write_tlv(self.tag, move |dest| dest.push_slice(self.data))
Expand Down Expand Up @@ -198,7 +198,7 @@ impl<'a> SimpleAsn1Readable<'a> for &'a [u8] {
}
}

impl<'a> SimpleAsn1Writable for &'a [u8] {
impl SimpleAsn1Writable for &[u8] {
const TAG: Tag = Tag::primitive(0x04);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self)
Expand Down Expand Up @@ -317,7 +317,7 @@ impl<'a> SimpleAsn1Readable<'a> for PrintableString<'a> {
}
}

impl<'a> SimpleAsn1Writable for PrintableString<'a> {
impl SimpleAsn1Writable for PrintableString<'_> {
const TAG: Tag = Tag::primitive(0x13);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self.0.as_bytes())
Expand Down Expand Up @@ -366,7 +366,7 @@ impl<'a> SimpleAsn1Readable<'a> for IA5String<'a> {
IA5String::new_from_bytes(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
}
}
impl<'a> SimpleAsn1Writable for IA5String<'a> {
impl SimpleAsn1Writable for IA5String<'_> {
const TAG: Tag = Tag::primitive(0x16);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self.0.as_bytes())
Expand Down Expand Up @@ -399,7 +399,7 @@ impl<'a> SimpleAsn1Readable<'a> for Utf8String<'a> {
.ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
}
}
impl<'a> SimpleAsn1Writable for Utf8String<'a> {
impl SimpleAsn1Writable for Utf8String<'_> {
const TAG: Tag = Tag::primitive(0x0c);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self.0.as_bytes())
Expand Down Expand Up @@ -454,7 +454,7 @@ impl<'a> SimpleAsn1Readable<'a> for VisibleString<'a> {
.ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
}
}
impl<'a> SimpleAsn1Writable for VisibleString<'a> {
impl SimpleAsn1Writable for VisibleString<'_> {
const TAG: Tag = Tag::primitive(0x1a);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self.0.as_bytes())
Expand Down Expand Up @@ -504,7 +504,7 @@ impl<'a> SimpleAsn1Readable<'a> for BMPString<'a> {
BMPString::new(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
}
}
impl<'a> SimpleAsn1Writable for BMPString<'a> {
impl SimpleAsn1Writable for BMPString<'_> {
const TAG: Tag = Tag::primitive(0x1e);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self.as_utf16_be_bytes())
Expand Down Expand Up @@ -554,7 +554,7 @@ impl<'a> SimpleAsn1Readable<'a> for UniversalString<'a> {
UniversalString::new(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
}
}
impl<'a> SimpleAsn1Writable for UniversalString<'a> {
impl SimpleAsn1Writable for UniversalString<'_> {
const TAG: Tag = Tag::primitive(0x1c);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self.as_utf32_be_bytes())
Expand Down Expand Up @@ -666,7 +666,7 @@ impl<'a> SimpleAsn1Readable<'a> for BigUint<'a> {
BigUint::new(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
}
}
impl<'a> SimpleAsn1Writable for BigUint<'a> {
impl SimpleAsn1Writable for BigUint<'_> {
const TAG: Tag = Tag::primitive(0x02);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self.as_bytes())
Expand Down Expand Up @@ -746,7 +746,7 @@ impl<'a> SimpleAsn1Readable<'a> for BigInt<'a> {
BigInt::new(data).ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
}
}
impl<'a> SimpleAsn1Writable for BigInt<'a> {
impl SimpleAsn1Writable for BigInt<'_> {
const TAG: Tag = Tag::primitive(0x02);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_slice(self.as_bytes())
Expand Down Expand Up @@ -818,7 +818,7 @@ impl<'a> SimpleAsn1Readable<'a> for BitString<'a> {
.ok_or_else(|| ParseError::new(ParseErrorKind::InvalidValue))
}
}
impl<'a> SimpleAsn1Writable for BitString<'a> {
impl SimpleAsn1Writable for BitString<'_> {
const TAG: Tag = Tag::primitive(0x03);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
dest.push_byte(self.padding_bits())?;
Expand Down Expand Up @@ -1236,7 +1236,7 @@ impl<'a> SimpleAsn1Readable<'a> for Sequence<'a> {
Ok(Sequence::new(data))
}
}
impl<'a> SimpleAsn1Writable for Sequence<'a> {
impl SimpleAsn1Writable for Sequence<'_> {
const TAG: Tag = Tag::constructed(0x10);
#[inline]
fn write_data(&self, data: &mut WriteBuf) -> WriteResult {
Expand All @@ -1257,7 +1257,7 @@ impl<'a> SequenceWriter<'a> {
}
}

impl<'a> SimpleAsn1Writable for SequenceWriter<'a> {
impl SimpleAsn1Writable for SequenceWriter<'_> {
const TAG: Tag = Tag::constructed(0x10);
#[inline]
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
Expand Down Expand Up @@ -1417,7 +1417,7 @@ pub struct SequenceOfWriter<'a, T: Asn1Writable, V: Borrow<[T]> = &'a [T]> {
_phantom: PhantomData<&'a T>,
}

impl<'a, T: Asn1Writable, V: Borrow<[T]>> SequenceOfWriter<'a, T, V> {
impl<T: Asn1Writable, V: Borrow<[T]>> SequenceOfWriter<'_, T, V> {
pub fn new(vals: V) -> Self {
SequenceOfWriter {
vals,
Expand All @@ -1426,7 +1426,7 @@ impl<'a, T: Asn1Writable, V: Borrow<[T]>> SequenceOfWriter<'a, T, V> {
}
}

impl<'a, T: Asn1Writable, V: Borrow<[T]>> SimpleAsn1Writable for SequenceOfWriter<'a, T, V> {
impl<T: Asn1Writable, V: Borrow<[T]>> SimpleAsn1Writable for SequenceOfWriter<'_, T, V> {
const TAG: Tag = Tag::constructed(0x10);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
let mut w = Writer::new(dest);
Expand Down Expand Up @@ -1558,7 +1558,7 @@ pub struct SetOfWriter<'a, T: Asn1Writable, V: Borrow<[T]> = &'a [T]> {
_phantom: PhantomData<&'a T>,
}

impl<'a, T: Asn1Writable, V: Borrow<[T]>> SetOfWriter<'a, T, V> {
impl<T: Asn1Writable, V: Borrow<[T]>> SetOfWriter<'_, T, V> {
pub fn new(vals: V) -> Self {
SetOfWriter {
vals,
Expand All @@ -1567,7 +1567,7 @@ impl<'a, T: Asn1Writable, V: Borrow<[T]>> SetOfWriter<'a, T, V> {
}
}

impl<'a, T: Asn1Writable, V: Borrow<[T]>> SimpleAsn1Writable for SetOfWriter<'a, T, V> {
impl<T: Asn1Writable, V: Borrow<[T]>> SimpleAsn1Writable for SetOfWriter<'_, T, V> {
const TAG: Tag = Tag::constructed(0x11);
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult {
let vals = self.vals.borrow();
Expand Down