From f67fd87e573ed5e5b8f6b5990beb7e2daa91605e Mon Sep 17 00:00:00 2001 From: Michael Goldenberg Date: Mon, 23 Jun 2025 10:29:17 -0400 Subject: [PATCH] refactor(indexeddb): rename IndexedKeyBounds fn's so they are consistent Signed-off-by: Michael Goldenberg --- .../src/event_cache_store/serializer/mod.rs | 4 ++-- .../src/event_cache_store/serializer/traits.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/mod.rs b/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/mod.rs index a77ba5332..a6c8b9a62 100644 --- a/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/mod.rs +++ b/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/mod.rs @@ -98,8 +98,8 @@ impl IndexeddbEventCacheStoreSerializer { T: Indexed, K: IndexedKeyBounds + Serialize, { - let lower = serde_wasm_bindgen::to_value(&K::encode_lower(room_id, &self.inner))?; - let upper = serde_wasm_bindgen::to_value(&K::encode_upper(room_id, &self.inner))?; + let lower = serde_wasm_bindgen::to_value(&K::lower_key(room_id, &self.inner))?; + let upper = serde_wasm_bindgen::to_value(&K::upper_key(room_id, &self.inner))?; IdbKeyRange::bound(&lower, &upper).map_err(Into::into) } diff --git a/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/traits.rs b/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/traits.rs index 7572fc972..be2f3821d 100644 --- a/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/traits.rs +++ b/crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/traits.rs @@ -71,8 +71,8 @@ pub trait IndexedKeyBounds: IndexedKey { /// Constructs the lower bound of the key components. fn lower_key_components() -> Self::KeyComponents; - /// Encodes the lower bound of the key. - fn encode_lower(room_id: &RoomId, serializer: &IndexeddbSerializer) -> Self + /// Constructs the lower bound of the key. + fn lower_key(room_id: &RoomId, serializer: &IndexeddbSerializer) -> Self where Self: Sized, { @@ -82,8 +82,8 @@ pub trait IndexedKeyBounds: IndexedKey { /// Constructs the upper bound of the key components. fn upper_key_components() -> Self::KeyComponents; - /// Encodes the upper bound of the key. - fn encode_upper(room_id: &RoomId, serializer: &IndexeddbSerializer) -> Self + /// Constructs the upper bound of the key. + fn upper_key(room_id: &RoomId, serializer: &IndexeddbSerializer) -> Self where Self: Sized, {