Skip to content

Commit 46f22fb

Browse files
committed
chore: Rename BackingStore::Error to BackingStore::LockingError.
The idea is to avoid name conflicts when implementing other traits that use the `Error` associated type.
1 parent f2c3ae6 commit 46f22fb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/matrix-sdk-common/src/store_locks.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ use crate::{
5858
#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
5959
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
6060
pub trait BackingStore {
61-
type Error: Error + Send + Sync;
61+
type LockError: Error + Send + Sync;
6262

6363
/// Try to take a lock using the given store.
6464
async fn try_lock(
6565
&self,
6666
lease_duration_ms: u32,
6767
key: &str,
6868
holder: &str,
69-
) -> Result<bool, Self::Error>;
69+
) -> Result<bool, Self::LockError>;
7070
}
7171

7272
/// Small state machine to handle wait times.
@@ -400,15 +400,15 @@ mod tests {
400400
#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
401401
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
402402
impl BackingStore for TestStore {
403-
type Error = DummyError;
403+
type LockError = DummyError;
404404

405405
/// Try to take a lock using the given store.
406406
async fn try_lock(
407407
&self,
408408
lease_duration_ms: u32,
409409
key: &str,
410410
holder: &str,
411-
) -> Result<bool, Self::Error> {
411+
) -> Result<bool, Self::LockError> {
412412
Ok(self.try_take_leased_lock(lease_duration_ms, key, holder))
413413
}
414414
}

crates/matrix-sdk-crypto/src/store/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,14 +1925,14 @@ pub struct LockableCryptoStore(Arc<dyn CryptoStore<Error = CryptoStoreError>>);
19251925
#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
19261926
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
19271927
impl matrix_sdk_common::store_locks::BackingStore for LockableCryptoStore {
1928-
type Error = CryptoStoreError;
1928+
type LockError = CryptoStoreError;
19291929

19301930
async fn try_lock(
19311931
&self,
19321932
lease_duration_ms: u32,
19331933
key: &str,
19341934
holder: &str,
1935-
) -> std::result::Result<bool, Self::Error> {
1935+
) -> std::result::Result<bool, Self::LockError> {
19361936
self.0.try_take_leased_lock(lease_duration_ms, key, holder).await
19371937
}
19381938
}

0 commit comments

Comments
 (0)