From 8cfbbfe1b3be69c0aa7bf11c8394e3fc3cf5940e Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sat, 24 Jun 2023 20:39:46 -0700 Subject: [PATCH] use default derive helpers --- web3_proxy/src/rpcs/request.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/web3_proxy/src/rpcs/request.rs b/web3_proxy/src/rpcs/request.rs index 4c3a9b1c..41749688 100644 --- a/web3_proxy/src/rpcs/request.rs +++ b/web3_proxy/src/rpcs/request.rs @@ -36,9 +36,10 @@ pub struct OpenRequestHandle { } /// Depending on the context, RPC errors require different handling. -#[derive(Copy, Debug, Clone)] +#[derive(Copy, Clone, Debug, Default)] pub enum RequestErrorHandler { /// Log at the trace level. Use when errors are expected. + #[default] TraceLevel, /// Log at the debug level. Use when errors are expected. DebugLevel, @@ -50,12 +51,6 @@ pub enum RequestErrorHandler { Save, } -impl Default for RequestErrorHandler { - fn default() -> Self { - Self::TraceLevel - } -} - // TODO: second param could be skipped since we don't need it here #[derive(serde::Deserialize, serde::Serialize)] struct EthCallParams((EthCallFirstParams, Option));