From 851e90f875fc34ff471a578a7ad707095abfba98 Mon Sep 17 00:00:00 2001 From: Surinder Singh Matoo Date: Fri, 6 Oct 2023 05:32:28 +0530 Subject: [PATCH] lint cleanup --- wallet/core/src/settings.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wallet/core/src/settings.rs b/wallet/core/src/settings.rs index 8174496f7..8030700fb 100644 --- a/wallet/core/src/settings.rs +++ b/wallet/core/src/settings.rs @@ -101,13 +101,16 @@ where None }; - let list = - list.unwrap_or(Value::Object(Map::from_iter(::defaults().await.into_iter().map(|(k, v)| { + let list = if let Some(value) = list { + value + } else { + Value::Object(Map::from_iter(::defaults().await.into_iter().map(|(k, v)| { let ks = to_value(k).unwrap(); let ks = ks.as_str().expect("Unable to convert key to string"); (ks.to_string(), v) - })))); + }))) + }; self.map.clear(); if let Value::Object(map) = list {