diff --git a/Cargo.toml b/Cargo.toml index 2e56eb8e5c..bbbb8d491e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -218,6 +218,7 @@ option_as_ref_cloned = "warn" or_fun_call = "warn" path_buf_push_overwrite = "warn" read_zero_byte_vec = "warn" +result_large_err = "allow" redundant_clone = "warn" redundant_else = "warn" single_char_pattern = "warn" diff --git a/bin/reth-bench/src/bench/send_payload.rs b/bin/reth-bench/src/bench/send_payload.rs index 4eaf046384..aa6067888f 100644 --- a/bin/reth-bench/src/bench/send_payload.rs +++ b/bin/reth-bench/src/bench/send_payload.rs @@ -7,7 +7,7 @@ use alloy_rpc_types_engine::ExecutionPayload; use clap::Parser; use eyre::{OptionExt, Result}; use reth_cli_runner::CliContext; -use std::io::{Read, Write}; +use std::io::{BufReader, Read, Write}; use super::rpc_transaction::RpcTransaction; @@ -60,7 +60,9 @@ impl Command { fn read_input(&self) -> Result { Ok(match &self.path { Some(path) => reth_fs_util::read_to_string(path)?, - None => String::from_utf8(std::io::stdin().bytes().collect::, _>>()?)?, + None => String::from_utf8( + BufReader::new(std::io::stdin()).bytes().collect::, _>>()?, + )?, }) } diff --git a/bin/reth/src/cli/mod.rs b/bin/reth/src/cli/mod.rs index e614a88f9f..b3a24fb1e3 100644 --- a/bin/reth/src/cli/mod.rs +++ b/bin/reth/src/cli/mod.rs @@ -202,6 +202,7 @@ impl, Ext: clap::Args + fmt::Debug> Cl /// Commands to be executed #[derive(Debug, Subcommand)] +#[allow(clippy::large_enum_variant)] pub enum Commands { /// Start the node #[command(name = "node")] diff --git a/crates/engine/tree/src/backfill.rs b/crates/engine/tree/src/backfill.rs index 8fa3c09949..70542f3407 100644 --- a/crates/engine/tree/src/backfill.rs +++ b/crates/engine/tree/src/backfill.rs @@ -212,6 +212,7 @@ impl BackfillSync for PipelineSync { /// blockchain tree any messages that would result in database writes, since it would result in a /// deadlock. #[derive(Debug)] +#[allow(clippy::large_enum_variant)] enum PipelineState { /// Pipeline is idle. Idle(Option>), diff --git a/crates/evm/execution-types/src/chain.rs b/crates/evm/execution-types/src/chain.rs index ccd35f2bd8..d6b73238e5 100644 --- a/crates/evm/execution-types/src/chain.rs +++ b/crates/evm/execution-types/src/chain.rs @@ -500,6 +500,7 @@ impl From for ChainSplitTarget { /// Result of a split chain. #[derive(Clone, Debug, PartialEq, Eq)] +#[allow(clippy::large_enum_variant)] pub enum ChainSplit { /// Chain is not split. Pending chain is returned. /// Given block split is higher than last block. diff --git a/crates/evm/execution-types/src/execution_outcome.rs b/crates/evm/execution-types/src/execution_outcome.rs index 88a1891c6c..7bc84c61ff 100644 --- a/crates/evm/execution-types/src/execution_outcome.rs +++ b/crates/evm/execution-types/src/execution_outcome.rs @@ -434,6 +434,7 @@ pub(super) mod serde_bincode_compat { bundle: Cow<'a, BundleState>, receipts: Vec>>, first_block: BlockNumber, + #[allow(clippy::owned_cow)] requests: Cow<'a, Vec>, } diff --git a/crates/exex/exex/src/notifications.rs b/crates/exex/exex/src/notifications.rs index 892b48181b..69fa07eaee 100644 --- a/crates/exex/exex/src/notifications.rs +++ b/crates/exex/exex/src/notifications.rs @@ -64,6 +64,7 @@ pub trait ExExNotificationsStream: } #[derive(Debug)] +#[allow(clippy::large_enum_variant)] enum ExExNotificationsInner where E: BlockExecutorProvider, diff --git a/crates/exex/types/src/notification.rs b/crates/exex/types/src/notification.rs index fb3d6c5069..aa54b1eb54 100644 --- a/crates/exex/types/src/notification.rs +++ b/crates/exex/types/src/notification.rs @@ -97,6 +97,7 @@ pub(super) mod serde_bincode_compat { #[derive(Debug, Serialize, Deserialize)] #[allow(missing_docs)] #[serde(bound = "")] + #[allow(clippy::large_enum_variant)] pub enum ExExNotification<'a, N = EthPrimitives> where N: NodePrimitives, diff --git a/crates/fs-util/src/lib.rs b/crates/fs-util/src/lib.rs index c1aa4900e0..922bec6bf6 100644 --- a/crates/fs-util/src/lib.rs +++ b/crates/fs-util/src/lib.rs @@ -9,7 +9,7 @@ use serde::{de::DeserializeOwned, Serialize}; use std::{ fs::{self, File, OpenOptions, ReadDir}, - io::{self, BufWriter, Error, ErrorKind, Write}, + io::{self, BufWriter, Error, Write}, path::{Path, PathBuf}, }; @@ -324,7 +324,7 @@ where File::create(&tmp_path).map_err(|err| FsPathError::create_file(err, &tmp_path))?; write_fn(&mut file).map_err(|err| FsPathError::Write { - source: Error::new(ErrorKind::Other, err.into()), + source: Error::other(err.into()), path: tmp_path.clone(), })?; diff --git a/crates/net/ecies/src/stream.rs b/crates/net/ecies/src/stream.rs index dbd7577a35..838703958d 100644 --- a/crates/net/ecies/src/stream.rs +++ b/crates/net/ecies/src/stream.rs @@ -68,7 +68,7 @@ where remote_id: PeerId, ) -> Result { let ecies = ECIESCodec::new_client(secret_key, remote_id) - .map_err(|_| io::Error::new(io::ErrorKind::Other, "invalid handshake"))?; + .map_err(|_| io::Error::other("invalid handshake"))?; let mut transport = ecies.framed(transport); @@ -137,10 +137,9 @@ where fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { match ready!(self.project().stream.poll_next(cx)) { Some(Ok(IngressECIESValue::Message(body))) => Poll::Ready(Some(Ok(body))), - Some(other) => Poll::Ready(Some(Err(io::Error::new( - io::ErrorKind::Other, - format!("ECIES stream protocol error: expected message, received {other:?}"), - )))), + Some(other) => Poll::Ready(Some(Err(io::Error::other(format!( + "ECIES stream protocol error: expected message, received {other:?}" + ))))), None => Poll::Ready(None), } } diff --git a/crates/optimism/cli/src/commands/mod.rs b/crates/optimism/cli/src/commands/mod.rs index 643bf503d8..4142af577d 100644 --- a/crates/optimism/cli/src/commands/mod.rs +++ b/crates/optimism/cli/src/commands/mod.rs @@ -19,6 +19,7 @@ pub mod test_vectors; /// Commands to be executed #[derive(Debug, Subcommand)] +#[allow(clippy::large_enum_variant)] pub enum Commands { /// Start the node diff --git a/crates/optimism/primitives/src/receipt.rs b/crates/optimism/primitives/src/receipt.rs index 05033592cd..fe9975a455 100644 --- a/crates/optimism/primitives/src/receipt.rs +++ b/crates/optimism/primitives/src/receipt.rs @@ -254,6 +254,7 @@ mod compact { tx_type: OpTxType, success: bool, cumulative_gas_used: u64, + #[allow(clippy::owned_cow)] logs: Cow<'a, Vec>, deposit_nonce: Option, deposit_receipt_version: Option, diff --git a/crates/primitives-traits/src/block/recovered.rs b/crates/primitives-traits/src/block/recovered.rs index fbba626c40..69550cfa76 100644 --- a/crates/primitives-traits/src/block/recovered.rs +++ b/crates/primitives-traits/src/block/recovered.rs @@ -563,6 +563,7 @@ pub(super) mod serde_bincode_compat { bound = "serde_bincode_compat::SealedBlock<'a, T>: Serialize + serde::de::DeserializeOwned" )] block: serde_bincode_compat::SealedBlock<'a, T>, + #[allow(clippy::owned_cow)] senders: Cow<'a, Vec
>, } diff --git a/crates/rpc/ipc/src/stream_codec.rs b/crates/rpc/ipc/src/stream_codec.rs index e6e035f1d5..598c030e0c 100644 --- a/crates/rpc/ipc/src/stream_codec.rs +++ b/crates/rpc/ipc/src/stream_codec.rs @@ -83,7 +83,7 @@ impl tokio_util::codec::Decoder for StreamCodec { match str::from_utf8(line.as_ref()) { Ok(s) => Ok(Some(s.to_string())), - Err(_) => Err(io::Error::new(io::ErrorKind::Other, "invalid UTF-8")), + Err(_) => Err(io::Error::other("invalid UTF-8")), } } else { Ok(None) diff --git a/examples/beacon-api-sidecar-fetcher/src/mined_sidecar.rs b/examples/beacon-api-sidecar-fetcher/src/mined_sidecar.rs index 2f5f682180..29775f13cb 100644 --- a/examples/beacon-api-sidecar-fetcher/src/mined_sidecar.rs +++ b/examples/beacon-api-sidecar-fetcher/src/mined_sidecar.rs @@ -43,6 +43,7 @@ pub struct ReorgedBlob { } #[derive(Debug, Clone)] +#[allow(clippy::large_enum_variant)] pub enum BlobTransactionEvent { Mined(MinedBlob), Reorged(ReorgedBlob),