mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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>
This commit is contained in:
parent
52119c339c
commit
1200617683
1 changed files with 2 additions and 2 deletions
|
@ -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:?}"
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue