Skip to content

Commit

Permalink
fixup! Add code example to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane committed Jan 28, 2024
1 parent 8748e15 commit 38cbfcf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/discv5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,10 @@ impl<P: ProtocolIdentity> Discv5<P> {
}

/// Takes a closure parameterized by type `Arc<RwLock<KBucketsTable<NodeId, Enr>>>` as
/// parameter. Caution: caller is responsible of dropping a lock taken on the kbuckets. We can
/// then for example take a read lock only to optimistically view the current keys in the
/// kbuckets (optimistic since it doesn't apply pending entries, which requires a write lock).
/// parameter. Caution: caller is responsible of dropping a lock taken on the kbuckets. For
/// example, a read lock can be taken on the kbuckets to optimistically view the current keys
/// in the kbuckets (optimistic since it doesn't apply pending entries, which requires a write
/// lock).
/// ```
/// use std::str::FromStr;
/// use discv5::{ConfigBuilder, Discv5, ListenConfig, Enr, enr::CombinedKey};
Expand Down

0 comments on commit 38cbfcf

Please sign in to comment.