From 1200617683faea9ef52406022f2b3109d646b9ce Mon Sep 17 00:00:00 2001 From: boluochoufeng <38886058+boluochoufeng@users.noreply.github.com> Date: Mon, 10 Mar 2025 23:16:11 +0800 Subject: [PATCH] Fix the parsing error of PrefValue::Array, which is used for the parsing of Preferences shell_background_color_rgba field (#35865) Signed-off-by: blycf <1355990831@qq.com> --- components/config/pref_util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/config/pref_util.rs b/components/config/pref_util.rs index 47598206e05..8f1bbca6cf8 100644 --- a/components/config/pref_util.rs +++ b/components/config/pref_util.rs @@ -43,8 +43,8 @@ impl TryFrom<&Value> for PrefValue { .unwrap_or(Err("Could not parse number from JSON".into())), Value::String(value) => Ok(value.clone().into()), Value::Array(array) => { - let mut array = array.iter().map(TryInto::try_into); - if !array.all(|v| v.is_ok()) { + let array = array.iter().map(TryInto::try_into); + if !array.clone().all(|v| v.is_ok()) { return Err(format!( "Cannot turn all array avlues into preference: {array:?}" ));