chore: add and fix more lints, improve docs (#4765)

This commit is contained in:
DaniPopes
2023-09-25 17:46:46 +02:00
committed by GitHub
parent b701cbc9a3
commit 8f9d2908ca
134 changed files with 709 additions and 625 deletions

View File

@ -85,6 +85,7 @@ impl StatusBuilder {
}
/// Builder for [`HelloMessage`] messages.
#[derive(Debug)]
pub struct HelloBuilder {
hello: HelloMessage,
}

View File

@ -24,6 +24,7 @@ pub const MAX_MESSAGE_SIZE: usize = 10 * 1024 * 1024;
/// An un-authenticated [`EthStream`]. This is consumed and returns a [`EthStream`] after the
/// `Status` handshake is completed.
#[pin_project]
#[derive(Debug)]
pub struct UnauthedEthStream<S> {
#[pin]
inner: S,

View File

@ -45,6 +45,7 @@ impl HelloMessage {
}
}
#[derive(Debug)]
pub struct HelloMessageBuilder {
/// The version of the `p2p` protocol.
pub protocol_version: Option<ProtocolVersion>,

View File

@ -1,15 +1,3 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxzy/reth/issues/"
)]
#![warn(missing_docs, unreachable_pub)]
#![deny(unused_must_use, rust_2018_idioms)]
#![doc(test(
no_crate_inject,
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! Implementation of the `eth` wire protocol.
//!
//! ## Feature Flags
@ -17,6 +5,15 @@
//! - `serde` (default): Enable serde support
//! - `arbitrary`: Adds `proptest` and `arbitrary` support for wire types.
#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxzy/reth/issues/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
pub mod builder;
pub mod capability;
mod disconnect;

View File

@ -65,6 +65,7 @@ const MAX_P2P_CAPACITY: usize = 2;
/// An un-authenticated [`P2PStream`]. This is consumed and returns a [`P2PStream`] after the
/// `Hello` handshake is completed.
#[pin_project]
#[derive(Debug)]
pub struct UnauthedP2PStream<S> {
#[pin]
inner: S,