clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674)

This commit is contained in:
Martin Robinson 2024-07-04 16:18:58 +02:00 committed by GitHub
parent 99c1f886b8
commit 4b63043c6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 72 additions and 78 deletions

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::collections::HashMap;
use std::convert::TryInto;
use std::fmt;
use std::str::FromStr;
use std::sync::RwLock;
@ -158,10 +157,7 @@ impl From<PrefValue> for [f64; 4] {
fn from(other: PrefValue) -> [f64; 4] {
match other {
PrefValue::Array(values) if values.len() == 4 => {
let f = values
.into_iter()
.filter_map(|v| v.try_into().ok())
.collect::<Vec<f64>>();
let f = values.into_iter().map(Into::into).collect::<Vec<f64>>();
if f.len() == 4 {
[f[0], f[1], f[2], f[3]]
} else {