From 9f11bced1039e4e5c58acf522e5d0eb4fe2acf11 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 30 Oct 2024 11:06:15 +0100 Subject: [PATCH] chore: Rename `BackingStore::Error` to `BackingStore::LockingError`. The idea is to avoid name conflicts when implementing other traits that use the `Error` associated type. --- crates/matrix-sdk-common/src/store_locks.rs | 8 ++++---- crates/matrix-sdk-crypto/src/store/mod.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/matrix-sdk-common/src/store_locks.rs b/crates/matrix-sdk-common/src/store_locks.rs index d97dac03a..6ee4de48a 100644 --- a/crates/matrix-sdk-common/src/store_locks.rs +++ b/crates/matrix-sdk-common/src/store_locks.rs @@ -58,7 +58,7 @@ use crate::{ #[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] pub trait BackingStore { - type Error: Error + Send + Sync; + type LockError: Error + Send + Sync; /// Try to take a lock using the given store. async fn try_lock( @@ -66,7 +66,7 @@ pub trait BackingStore { lease_duration_ms: u32, key: &str, holder: &str, - ) -> Result; + ) -> Result; } /// Small state machine to handle wait times. @@ -400,7 +400,7 @@ mod tests { #[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] impl BackingStore for TestStore { - type Error = DummyError; + type LockError = DummyError; /// Try to take a lock using the given store. async fn try_lock( @@ -408,7 +408,7 @@ mod tests { lease_duration_ms: u32, key: &str, holder: &str, - ) -> Result { + ) -> Result { Ok(self.try_take_leased_lock(lease_duration_ms, key, holder)) } } diff --git a/crates/matrix-sdk-crypto/src/store/mod.rs b/crates/matrix-sdk-crypto/src/store/mod.rs index 92fdc6f32..9b8d06e31 100644 --- a/crates/matrix-sdk-crypto/src/store/mod.rs +++ b/crates/matrix-sdk-crypto/src/store/mod.rs @@ -1925,14 +1925,14 @@ pub struct LockableCryptoStore(Arc>); #[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] impl matrix_sdk_common::store_locks::BackingStore for LockableCryptoStore { - type Error = CryptoStoreError; + type LockError = CryptoStoreError; async fn try_lock( &self, lease_duration_ms: u32, key: &str, holder: &str, - ) -> std::result::Result { + ) -> std::result::Result { self.0.try_take_leased_lock(lease_duration_ms, key, holder).await } }