Skip to content

Commit

Permalink
Add caution to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane committed Apr 15, 2024
1 parent c5c33d7 commit 13ce7f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ impl<K: EnrKey> Enr<K> {
self.seq
}

/// Reads a custom key from the record if it exists, decoded as data.
/// Reads a custom key from the record if it exists, decoded as data. Caution! Only use for
/// data that is not an aggregate type. Default to using [`get_decodable`](Enr::get_decodable).
#[allow(clippy::missing_panics_doc)]
pub fn get(&self, key: impl AsRef<[u8]>) -> Option<Bytes> {
// It's ok to decode any valid RLP value as data
self.get_raw_rlp(key).map(|mut rlp_data| {
let raw_data = &mut rlp_data;
let header = Header::decode(raw_data).expect("All data is sanitized");
Expand Down

0 comments on commit 13ce7f2

Please sign in to comment.