@@ -422,15 +422,7 @@ build_config! {
422422 // Development related section.
423423 (
424424 log_level, ( LevelFilter ) , LevelFilter :: Info , |l| {
425- match l {
426- "off" => Ok ( LevelFilter :: Off ) ,
427- "error" => Ok ( LevelFilter :: Error ) ,
428- "warn" => Ok ( LevelFilter :: Warn ) ,
429- "info" => Ok ( LevelFilter :: Info ) ,
430- "debug" => Ok ( LevelFilter :: Debug ) ,
431- "trace" => Ok ( LevelFilter :: Trace ) ,
432- _ => Err ( "Invalid log_level" . to_owned( ) ) ,
433- }
425+ LevelFilter :: from_str( l) . map_err( |e| e. to_string( ) )
434426 }
435427 )
436428
@@ -449,11 +441,7 @@ build_config! {
449441 ( public_rpc_apis, ( ApiSet ) , ApiSet :: Safe , ApiSet :: from_str)
450442 ( public_evm_rpc_apis, ( EthApiSet ) , EthApiSet :: Evm , EthApiSet :: from_str)
451443 ( public_evm_rpc_async_apis, ( RpcModuleSelection ) , RpcModuleSelection :: Evm , RpcModuleSelection :: from_str)
452- ( single_mpt_space, ( Option <Space >) , None , |s| match s {
453- "native" => Ok ( Space :: Native ) ,
454- "evm" => Ok ( Space :: Ethereum ) ,
455- _ => Err ( "Invalid single_mpt_space" . to_owned( ) ) ,
456- } )
444+ ( single_mpt_space, ( Option <Space >) , None , Space :: from_str)
457445 }
458446}
459447
0 commit comments