mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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())),
|
.unwrap_or(Err("Could not parse number from JSON".into())),
|
||||||
Value::String(value) => Ok(value.clone().into()),
|
Value::String(value) => Ok(value.clone().into()),
|
||||||
Value::Array(array) => {
|
Value::Array(array) => {
|
||||||
let mut array = array.iter().map(TryInto::try_into);
|
let array = array.iter().map(TryInto::try_into);
|
||||||
if !array.all(|v| v.is_ok()) {
|
if !array.clone().all(|v| v.is_ok()) {
|
||||||
return Err(format!(
|
return Err(format!(
|
||||||
"Cannot turn all array avlues into preference: {array:?}"
|
"Cannot turn all array avlues into preference: {array:?}"
|
||||||
));
|
));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue