From d45e3fa386e62e0538b3d7ba399ceaec80fdd7ca Mon Sep 17 00:00:00 2001 From: asonix Date: Fri, 3 May 2024 22:35:20 -0500 Subject: [PATCH] Remove unused 'remove' repo method --- src/repo.rs | 5 ----- src/repo/postgres.rs | 18 ------------------ src/repo/sled.rs | 7 ------- 3 files changed, 30 deletions(-) diff --git a/src/repo.rs b/src/repo.rs index 9cbccc5..dfe3fcb 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -444,7 +444,6 @@ where pub(crate) trait SettingsRepo: BaseRepo { async fn set(&self, key: &'static str, value: Arc<[u8]>) -> Result<(), RepoError>; async fn get(&self, key: &'static str) -> Result>, RepoError>; - async fn remove(&self, key: &'static str) -> Result<(), RepoError>; } #[async_trait::async_trait(?Send)] @@ -459,10 +458,6 @@ where async fn get(&self, key: &'static str) -> Result>, RepoError> { T::get(self, key).await } - - async fn remove(&self, key: &'static str) -> Result<(), RepoError> { - T::remove(self, key).await - } } #[async_trait::async_trait(?Send)] diff --git a/src/repo/postgres.rs b/src/repo/postgres.rs index 6a546a9..cae7d09 100644 --- a/src/repo/postgres.rs +++ b/src/repo/postgres.rs @@ -1412,24 +1412,6 @@ impl SettingsRepo for PostgresRepo { Ok(opt) } - - #[tracing::instrument(level = "debug", skip(self))] - async fn remove(&self, input_key: &'static str) -> Result<(), RepoError> { - use schema::settings::dsl::*; - - let mut conn = self.get_connection().await?; - - diesel::delete(settings) - .filter(key.eq(input_key)) - .execute(&mut conn) - .with_metrics(crate::init_metrics::POSTGRES_SETTINGS_REMOVE) - .with_timeout(Duration::from_secs(5)) - .await - .map_err(|_| PostgresError::DbTimeout)? - .map_err(PostgresError::Diesel)?; - - Ok(()) - } } #[async_trait::async_trait(?Send)] diff --git a/src/repo/sled.rs b/src/repo/sled.rs index 575aa1e..af0e2cd 100644 --- a/src/repo/sled.rs +++ b/src/repo/sled.rs @@ -945,13 +945,6 @@ impl SettingsRepo for SledRepo { Ok(opt.map(|ivec| Arc::from(ivec.to_vec()))) } - - #[tracing::instrument(level = "trace", skip(self))] - async fn remove(&self, key: &'static str) -> Result<(), RepoError> { - b!(self.settings, settings.remove(key)); - - Ok(()) - } } fn variant_access_key(hash: &[u8], variant: &str) -> Vec {