Skip to content

Commit

Permalink
Fix warnings with clippy-nightly (missing Default, implicit bounds)
Browse files Browse the repository at this point in the history
  • Loading branch information
chifflier committed Apr 9, 2024
1 parent 93c8bc4 commit 2df46b6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/asn1_types/end_of_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ use core::convert::TryFrom;
#[derive(Debug)]
pub struct EndOfContent {}

impl Default for EndOfContent {
fn default() -> Self {
Self::new()
}
}

impl EndOfContent {
pub const fn new() -> Self {
EndOfContent {}
Expand Down
6 changes: 6 additions & 0 deletions src/asn1_types/null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ use core::convert::TryFrom;
#[derive(Debug, PartialEq, Eq)]
pub struct Null {}

impl Default for Null {
fn default() -> Self {
Self::new()
}
}

impl Null {
pub const fn new() -> Self {
Null {}
Expand Down
4 changes: 1 addition & 3 deletions src/asn1_types/oid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@ impl<'a> Oid<'a> {

/// Return an iterator over the sub-identifiers (arcs).
/// Returns `None` if at least one arc does not fit into `u64`.
pub fn iter(
&'_ self,
) -> Option<impl Iterator<Item = u64> + FusedIterator + ExactSizeIterator + '_> {
pub fn iter(&'_ self) -> Option<impl FusedIterator<Item = u64> + ExactSizeIterator + '_> {
// Check that every arc fits into u64
let bytes = if self.relative {
&self.asn1
Expand Down
6 changes: 6 additions & 0 deletions src/asn1_types/tagged/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ pub struct TaggedParserBuilder<TagKind, E = Error> {
_e: PhantomData<E>,
}

impl<TagKind, E> Default for TaggedParserBuilder<TagKind, E> {
fn default() -> Self {
Self::new()
}
}

impl<TagKind, E> TaggedParserBuilder<TagKind, E> {
/// Create a default `TaggedParserBuilder` builder
///
Expand Down

0 comments on commit 2df46b6

Please sign in to comment.