Eliminate doc warnings and fix some markdown (#18566)

* Fix link target in doc comment

* Fix formatting of log examples in process_instruction

* Fix doc markdown in solana-gossip

* Fix doc markdown in solana-runtime

* Escape square braces in doc comments to avoid warnings

* Surround 'account references' doc items in code spans to avoid warnings

* Fix code block in loader_upgradeable_instruction

* Fix doctest for loader_upgradable_instruction
This commit is contained in:
Brian Anderson
2021-07-15 19:40:07 -05:00
committed by GitHub
parent aeb30fa873
commit 37ee0b5599
12 changed files with 208 additions and 170 deletions

View File

@ -1,5 +1,8 @@
//! Persistent storage for accounts. For more information, see:
//! https://docs.solana.com/implemented-proposals/persistent-account-storage
//! Persistent storage for accounts.
//!
//! For more information, see:
//!
//! <https://docs.solana.com/implemented-proposals/persistent-account-storage>
use log::*;
use memmap2::MmapMut;

View File

@ -67,10 +67,12 @@ impl<T: BloomHashIndex> Bloom<T> {
_phantom: PhantomData::default(),
}
}
/// create filter optimal for num size given the `FALSE_RATE`
/// the keys are randomized for picking data out of a collision resistant hash of size
/// `keysize` bytes
/// https://hur.st/bloomfilter/
/// Create filter optimal for num size given the `FALSE_RATE`.
///
/// The keys are randomized for picking data out of a collision resistant hash of size
/// `keysize` bytes.
///
/// See <https://hur.st/bloomfilter/>.
pub fn random(num_items: usize, false_rate: f64, max_bits: usize) -> Self {
let m = Self::num_bits(num_items as f64, false_rate);
let num_bits = cmp::max(1, cmp::min(m as usize, max_bits));