@@ -28,7 +28,7 @@ pub async fn run_api(
2828    chains :  Arc < RwLock < HashMap < String ,  ApiBlockChainState > > > , 
2929    metrics_registry :  Arc < RwLock < Registry > > , 
3030    history :  Arc < History > , 
31-     config :  Arc < Config > , 
31+     config :  & Config , 
3232    mut  rx_exit :  watch:: Receiver < bool > , 
3333)  -> Result < ( ) >  { 
3434    #[ derive( OpenApi ) ]  
@@ -55,7 +55,7 @@ pub async fn run_api(
5555    ) ]  
5656    struct  ApiDoc ; 
5757
58-     let  api_state = api:: ApiState :: new ( chains,  metrics_registry,  history,  config. clone ( ) ) . await ; 
58+     let  api_state = api:: ApiState :: new ( chains,  metrics_registry,  history,  config) . await ; 
5959
6060    // Initialize Axum Router. Note the type here is a `Router<State>` due to the use of the 
6161    // `with_state` method which replaces `Body` with `State` in the type signature. 
@@ -87,7 +87,7 @@ pub async fn run_api(
8787pub  async  fn  run ( opts :  & RunOptions )  -> Result < ( ) >  { 
8888    // Load environment variables from a .env file if present 
8989    let  _ = dotenv:: dotenv ( ) . map_err ( |e| anyhow ! ( "Failed to load .env file: {}" ,  e) ) ?; 
90-     let  config = Arc :: new ( Config :: load ( & opts. config . config ) ?) ; 
90+     let  config = Config :: load ( & opts. config . config ) ?; 
9191    let  secret = config. provider . secret . load ( ) ?. ok_or ( anyhow ! ( 
9292        "Please specify a provider secret in the config file." 
9393    ) ) ?; 
@@ -171,7 +171,7 @@ pub async fn run(opts: &RunOptions) -> Result<()> {
171171        chains. clone ( ) , 
172172        metrics_registry. clone ( ) , 
173173        history, 
174-         config. clone ( ) , 
174+         & config, 
175175        rx_exit, 
176176    ) 
177177    . await ?; 
0 commit comments