Skip to content

Commit 044cd7f

Browse files
committed
small clippy fix
1 parent a54472a commit 044cd7f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/storage/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,15 @@ where
354354
S: StorageBacking + StorageSubscriber<S>,
355355
T: Serialize + DeserializeOwned + Clone + Send + Sync + PartialEq + 'static,
356356
{
357+
#[allow(clippy::collapsible_if)]
357358
fn save(&self) {
358359
// We want to save in the following conditions
359360
// - The value from the channel is different from the current value
360361
// - The value from the channel could not be determined, likely because it hasn't been set yet
361-
if let Some(payload) = self.channel.borrow().data.downcast_ref::<T>()
362-
&& *self.entry.data.read() == *payload
363-
{
364-
return;
362+
if let Some(payload) = self.channel.borrow().data.downcast_ref::<T>() {
363+
if *self.entry.data.read() == *payload {
364+
return;
365+
}
365366
}
366367
self.entry.save();
367368
}

0 commit comments

Comments
 (0)