add doc_markdown clippy lint (#8552)

Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-06-03 15:21:45 +02:00
committed by GitHub
parent 34af610b8e
commit 7c17c6e469
440 changed files with 2166 additions and 2145 deletions

View File

@ -59,10 +59,10 @@ pub struct Cli<Ext: clap::Args + fmt::Debug = NoArgs> {
/// port numbers that conflict with each other.
///
/// Changes to the following port numbers:
/// - DISCOVERY_PORT: default + `instance` - 1
/// - AUTH_PORT: default + `instance` * 100 - 100
/// - HTTP_RPC_PORT: default - `instance` + 1
/// - WS_RPC_PORT: default + `instance` * 2 - 2
/// - `DISCOVERY_PORT`: default + `instance` - 1
/// - `AUTH_PORT`: default + `instance` * 100 - 100
/// - `HTTP_RPC_PORT`: default - `instance` + 1
/// - `WS_RPC_PORT`: default + `instance` * 2 - 2
#[arg(long, value_name = "INSTANCE", global = true, default_value_t = 1, value_parser = value_parser!(u16).range(..=200))]
instance: u16,
@ -90,7 +90,7 @@ impl<Ext: clap::Args + fmt::Debug> Cli<Ext> {
/// Execute the configured cli command.
///
/// This accepts a closure that is used to launch the node via the
/// [NodeCommand](node::NodeCommand).
/// [`NodeCommand`](node::NodeCommand).
///
///
/// # Example

View File

@ -89,7 +89,7 @@ pub enum Subcommands {
Path,
}
/// db_ro_exec opens a database in read-only mode, and then execute with the provided command
/// `db_ro_exec` opens a database in read-only mode, and then execute with the provided command
macro_rules! db_ro_exec {
($chain:expr, $db_path:expr, $db_args:ident, $sfp:ident, $tool:ident, $command:block) => {
let db = open_db_read_only($db_path, $db_args)?;

View File

@ -20,7 +20,7 @@ use std::{
};
use tracing::error;
/// Available keybindings for the [DbListTUI]
/// Available keybindings for the [`DbListTUI`]
static CMDS: [(&str, &str); 6] = [
("q", "Quit"),
("", "Entry above"),
@ -30,8 +30,8 @@ static CMDS: [(&str, &str); 6] = [
("G", "Go to a specific page"),
];
/// Modified version of the [ListState] struct that exposes the `offset` field.
/// Used to make the [DbListTUI] keys clickable.
/// Modified version of the [`ListState`] struct that exposes the `offset` field.
/// Used to make the [`DbListTUI`] keys clickable.
struct ExpListState {
pub(crate) offset: usize,
}
@ -46,15 +46,15 @@ pub(crate) enum ViewMode {
}
enum Entries<T: Table> {
/// Pairs of [Table::Key] and [RawValue<Table::Value>]
/// Pairs of [`Table::Key`] and [`RawValue<Table::Value>`]
RawValues(Vec<(T::Key, RawValue<T::Value>)>),
/// Pairs of [Table::Key] and [Table::Value]
/// Pairs of [`Table::Key`] and [`Table::Value`]
Values(Vec<TableRow<T>>),
}
impl<T: Table> Entries<T> {
/// Creates new empty [Entries] as [Entries::RawValues] if `raw_values == true` and as
/// [Entries::Values] if `raw == false`.
/// Creates new empty [Entries] as [`Entries::RawValues`] if `raw_values == true` and as
/// [`Entries::Values`] if `raw == false`.
const fn new_with_raw_values(raw_values: bool) -> Self {
if raw_values {
Self::RawValues(Vec::new())
@ -63,8 +63,8 @@ impl<T: Table> Entries<T> {
}
}
/// Sets the internal entries [Vec], converting the [Table::Value] into [RawValue<Table::Value>]
/// if needed.
/// Sets the internal entries [Vec], converting the [`Table::Value`] into
/// [`RawValue<Table::Value>`] if needed.
fn set(&mut self, new_entries: Vec<TableRow<T>>) {
match self {
Self::RawValues(old_entries) => {
@ -83,8 +83,8 @@ impl<T: Table> Entries<T> {
}
}
/// Returns an iterator over keys of the internal [Vec]. For both [Entries::RawValues] and
/// [Entries::Values], this iterator will yield [Table::Key].
/// Returns an iterator over keys of the internal [Vec]. For both [`Entries::RawValues`] and
/// [`Entries::Values`], this iterator will yield [`Table::Key`].
const fn iter_keys(&self) -> EntriesKeyIter<'_, T> {
EntriesKeyIter { entries: self, index: 0 }
}
@ -210,7 +210,7 @@ where
self.reset();
}
/// Show the [DbListTUI] in the terminal.
/// Show the [`DbListTUI`] in the terminal.
pub(crate) fn run(mut self) -> eyre::Result<()> {
// Setup backend
enable_raw_mode()?;

View File

@ -62,10 +62,10 @@ pub struct NodeCommand<Ext: clap::Args + fmt::Debug = NoArgs> {
/// port numbers that conflict with each other.
///
/// Changes to the following port numbers:
/// - DISCOVERY_PORT: default + `instance` - 1
/// - AUTH_PORT: default + `instance` * 100 - 100
/// - HTTP_RPC_PORT: default - `instance` + 1
/// - WS_RPC_PORT: default + `instance` * 2 - 2
/// - `DISCOVERY_PORT`: default + `instance` - 1
/// - `AUTH_PORT`: default + `instance` * 100 - 100
/// - `HTTP_RPC_PORT`: default - `instance` + 1
/// - `WS_RPC_PORT`: default + `instance` * 2 - 2
#[arg(long, value_name = "INSTANCE", global = true, default_value_t = 1, value_parser = value_parser!(u16).range(..=200))]
pub instance: u16,
@ -119,7 +119,7 @@ impl NodeCommand {
Self::parse()
}
/// Parsers only the default [NodeCommand] arguments from the given iterator
/// Parsers only the default [`NodeCommand`] arguments from the given iterator
pub fn try_parse_args_from<I, T>(itr: I) -> Result<Self, clap::error::Error>
where
I: IntoIterator<Item = T>,

View File

@ -117,8 +117,8 @@ fn import_tables_with_range<DB: Database>(
Ok(())
}
/// Dry-run an unwind to FROM block, so we can get the PlainStorageState and
/// PlainAccountState safely. There might be some state dependency from an address
/// Dry-run an unwind to FROM block, so we can get the `PlainStorageState` and
/// `PlainAccountState` safely. There might be some state dependency from an address
/// which hasn't been changed in the given range.
async fn unwind_and_copy<DB: Database>(
db_tool: &DbTool<DB>,

View File

@ -70,9 +70,9 @@ pub struct Command {
pub enum Stages {
/// Execution stage.
Execution(StageCommand),
/// StorageHashing stage.
/// `StorageHashing` stage.
StorageHashing(StageCommand),
/// AccountHashing stage.
/// `AccountHashing` stage.
AccountHashing(StageCommand),
/// Merkle stage.
Merkle(StageCommand),

View File

@ -29,7 +29,7 @@ pub use reth_node_core::utils::*;
pub struct DbTool<DB: Database> {
/// The provider factory that the db tool will use.
pub provider_factory: ProviderFactory<DB>,
/// The [ChainSpec] that the db tool will use.
/// The [`ChainSpec`] that the db tool will use.
pub chain: Arc<ChainSpec>,
}
@ -126,7 +126,7 @@ impl<DB: Database> DbTool<DB> {
self.provider_factory.db_ref().view(|tx| tx.get::<T>(key))?.map_err(|e| eyre::eyre!(e))
}
/// Grabs the content of the DupSort table for the given key and subkey
/// Grabs the content of the `DupSort` table for the given key and subkey
pub fn get_dup<T: DupSort>(&self, key: T::Key, subkey: T::SubKey) -> Result<Option<T::Value>> {
self.provider_factory
.db_ref()