From e5d4ea5964ff6ae8f0ed0a7a848fe2b284ea46b2 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 29 Oct 2024 17:10:57 +0100 Subject: [PATCH] chore(base): Simplify `&*` with `.as_ref()` or `.deref()`. This patch replaces a `&*` by a `.as_ref()` and a `.deref()`. The result is the same but it's just simpler for newcomers to understand what happens. --- crates/matrix-sdk-base/src/client.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/matrix-sdk-base/src/client.rs b/crates/matrix-sdk-base/src/client.rs index 36485c13e..8dd67f83b 100644 --- a/crates/matrix-sdk-base/src/client.rs +++ b/crates/matrix-sdk-base/src/client.rs @@ -13,11 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[cfg(feature = "e2e-encryption")] -use std::ops::Deref; use std::{ collections::{BTreeMap, BTreeSet}, fmt, iter, + ops::Deref, sync::Arc, }; @@ -252,12 +251,12 @@ impl BaseClient { /// Get a reference to the store. #[allow(unknown_lints, clippy::explicit_auto_deref)] pub fn store(&self) -> &DynStateStore { - &*self.store + self.store.deref() } /// Get a reference to the event cache store. pub fn event_cache_store(&self) -> &DynEventCacheStore { - &*self.event_cache_store + self.event_cache_store.as_ref() } /// Is the client logged in.