Skip to content

Commit fa71bb0

Browse files
committed
fix linting
1 parent ed62381 commit fa71bb0

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

src/cache/level/redis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ where
214214
{
215215
fn from_redis_value(v: Value) -> Result<Self, ParsingError> {
216216
let v: String = from_redis_value(v)?;
217-
Ok(serde_json::from_str(&v).map_err(|err| ParsingError::from(err.to_string()))?)
217+
serde_json::from_str(&v).map_err(|err| ParsingError::from(err.to_string()))
218218
}
219219
}
220220

src/cache/mod.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,10 @@ where
111111
)]
112112
pub async fn get_uuid(&self, key: &str) -> Cached<UuidData> {
113113
let local = self.local_cache.get_uuid(key).await;
114-
if let Some(entry) = &local {
115-
if !entry.is_expired(&self.expiry.uuid) {
114+
if let Some(entry) = &local
115+
&& !entry.is_expired(&self.expiry.uuid) {
116116
return Cached::with_expiry(local, &self.expiry.uuid);
117117
}
118-
}
119118

120119
let remote = self.remote_cache.get_uuid(key).await;
121120
match &remote {
@@ -154,11 +153,10 @@ where
154153
)]
155154
pub async fn get_profile(&self, uuid: &Uuid) -> Cached<ProfileData> {
156155
let local = self.local_cache.get_profile(uuid).await;
157-
if let Some(entry) = &local {
158-
if !entry.is_expired(&self.expiry.profile) {
156+
if let Some(entry) = &local
157+
&& !entry.is_expired(&self.expiry.profile) {
159158
return Cached::with_expiry(local, &self.expiry.profile);
160159
}
161-
}
162160

163161
let remote = self.remote_cache.get_profile(uuid).await;
164162
match &remote {
@@ -197,11 +195,10 @@ where
197195
)]
198196
pub async fn get_skin(&self, uuid: &Uuid) -> Cached<SkinData> {
199197
let local = self.local_cache.get_skin(uuid).await;
200-
if let Some(entry) = &local {
201-
if !entry.is_expired(&self.expiry.skin) {
198+
if let Some(entry) = &local
199+
&& !entry.is_expired(&self.expiry.skin) {
202200
return Cached::with_expiry(local, &self.expiry.skin);
203201
}
204-
}
205202

206203
let remote = self.remote_cache.get_skin(uuid).await;
207204
match &remote {
@@ -240,11 +237,10 @@ where
240237
)]
241238
pub async fn get_cape(&self, uuid: &Uuid) -> Cached<CapeData> {
242239
let local = self.local_cache.get_cape(uuid).await;
243-
if let Some(entry) = &local {
244-
if !entry.is_expired(&self.expiry.cape) {
240+
if let Some(entry) = &local
241+
&& !entry.is_expired(&self.expiry.cape) {
245242
return Cached::with_expiry(local, &self.expiry.cape);
246243
}
247-
}
248244

249245
let remote = self.remote_cache.get_cape(uuid).await;
250246
match &remote {
@@ -283,11 +279,10 @@ where
283279
)]
284280
pub async fn get_head(&self, uuid: &(Uuid, bool)) -> Cached<HeadData> {
285281
let local = self.local_cache.get_head(uuid).await;
286-
if let Some(entry) = &local {
287-
if !entry.is_expired(&self.expiry.head) {
282+
if let Some(entry) = &local
283+
&& !entry.is_expired(&self.expiry.head) {
288284
return Cached::with_expiry(local, &self.expiry.head);
289285
}
290-
}
291286

292287
let remote = self.remote_cache.get_head(uuid).await;
293288
match &remote {

0 commit comments

Comments
 (0)