Skip to content

Commit

Permalink
address clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jxs committed Aug 31, 2023
1 parent 8ef1566 commit 0c71192
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ impl<K: EnrKey> Enr<K> {
}

/// Reads a custom key from the record if it exists, decoded as data.
#[allow(clippy::missing_panics_doc)]
pub fn get(&self, key: impl AsRef<[u8]>) -> Option<&[u8]> {
// It's ok to decode any valid RLP value as data
self.get_raw_rlp(key).map(|rlp_data| {
Expand Down Expand Up @@ -401,6 +402,9 @@ impl<K: EnrKey> Enr<K> {
}

/// Returns the public key of the ENR record.
/// # Panics
///
/// Will panic if the public key is not supported.
#[must_use]
pub fn public_key(&self) -> K::PublicKey {
K::enr_to_public(&self.content).expect("ENR's can only be created with supported keys")
Expand Down Expand Up @@ -830,6 +834,7 @@ impl<K: EnrKey> std::fmt::Display for Enr<K> {
}
}

#[allow(clippy::missing_fields_in_debug)]
impl<K: EnrKey> std::fmt::Debug for Enr<K> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
struct OtherPairs<'a>(&'a BTreeMap<Key, Bytes>);
Expand Down

0 comments on commit 0c71192

Please sign in to comment.