From 733ea184a820c02181c75baffb30e8387c604271 Mon Sep 17 00:00:00 2001 From: bexan Date: Fri, 23 Aug 2024 14:28:33 +0200 Subject: [PATCH] cargo fmt --- crates/ark-metadata/src/elasticsearch_manager.rs | 2 -- crates/ark-metadata/src/metadata_manager.rs | 13 ++++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/ark-metadata/src/elasticsearch_manager.rs b/crates/ark-metadata/src/elasticsearch_manager.rs index 823d7919d..d1013e45f 100644 --- a/crates/ark-metadata/src/elasticsearch_manager.rs +++ b/crates/ark-metadata/src/elasticsearch_manager.rs @@ -2,7 +2,6 @@ use crate::types::{RequestError, TokenMetadata}; use async_trait::async_trait; pub struct NoOpElasticsearchManager; - #[cfg(any(test, feature = "mock"))] use mockall::automock; @@ -18,7 +17,6 @@ pub trait ElasticsearchManager { ) -> Result<(), RequestError>; } - #[async_trait] impl ElasticsearchManager for NoOpElasticsearchManager { async fn upsert_token_metadata( diff --git a/crates/ark-metadata/src/metadata_manager.rs b/crates/ark-metadata/src/metadata_manager.rs index 781203684..8d3daff14 100644 --- a/crates/ark-metadata/src/metadata_manager.rs +++ b/crates/ark-metadata/src/metadata_manager.rs @@ -1,3 +1,4 @@ +use crate::elasticsearch_manager::NoOpElasticsearchManager; use crate::{ elasticsearch_manager::ElasticsearchManager, file_manager::{FileInfo, FileManager}, @@ -16,7 +17,6 @@ use starknet::core::types::{BlockId, BlockTag, FieldElement}; use starknet::macros::selector; use std::{str::FromStr, time::Duration}; use tracing::{debug, error, trace}; -use crate::elasticsearch_manager::NoOpElasticsearchManager; /// `MetadataManager` is responsible for managing metadata information related to tokens. /// It works with the underlying storage and Starknet client to fetch and update token metadata. @@ -186,13 +186,12 @@ impl<'a, T: Storage, C: StarknetClient, F: FileManager, E: ElasticsearchManager> .await .map_err(MetadataError::DatabaseError)?; - if let Some(elasticsearch_manager) = self.elasticsearch_manager { - elasticsearch_manager - .upsert_token_metadata(contract_address, token_id, chain_id, token_metadata) - .await - .map_err(|e| MetadataError::ElasticSearchError(e.to_string()))?; - } + elasticsearch_manager + .upsert_token_metadata(contract_address, token_id, chain_id, token_metadata) + .await + .map_err(|e| MetadataError::ElasticSearchError(e.to_string()))?; + } Ok(()) }