aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/mediadevices.rs
diff options
context:
space:
mode:
authorOluwatobi Sofela <60105594+oluwatobiss@users.noreply.github.com>2024-03-28 16:58:36 +0100
committerGitHub <noreply@github.com>2024-03-28 15:58:36 +0000
commit7349ce5b6a4c522d966f5e79f1b097a82db3a575 (patch)
tree0f45e60f052a79c56c7967a27b023bf7d795b116 /components/script/dom/mediadevices.rs
parent5d518ca8dc25157aa19aec3d2dacef21ef0c0294 (diff)
downloadservo-7349ce5b6a4c522d966f5e79f1b097a82db3a575.tar.gz
servo-7349ce5b6a4c522d966f5e79f1b097a82db3a575.zip
clippy: Fix manual_map warnings (#31922)
Diffstat (limited to 'components/script/dom/mediadevices.rs')
-rw-r--r--components/script/dom/mediadevices.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/components/script/dom/mediadevices.rs b/components/script/dom/mediadevices.rs
index 8739510a82b..1da57905dae 100644
--- a/components/script/dom/mediadevices.rs
+++ b/components/script/dom/mediadevices.rs
@@ -130,11 +130,8 @@ fn convert_culong(js: &ConstrainULong) -> Option<Constrain<u32>> {
max: range.parent.max,
ideal: range.ideal,
}))
- } else if let Some(exact) = range.exact {
- Some(Constrain::Value(exact))
} else {
- // the unspecified case is treated as all three being none
- None
+ range.exact.map(Constrain::Value)
}
},
}
@@ -150,11 +147,8 @@ fn convert_cdouble(js: &ConstrainDouble) -> Option<Constrain<f64>> {
max: range.parent.max.map(|x| *x),
ideal: range.ideal.map(|x| *x),
}))
- } else if let Some(exact) = range.exact {
- Some(Constrain::Value(*exact))
} else {
- // the unspecified case is treated as all three being none
- None
+ range.exact.map(|exact| Constrain::Value(*exact))
}
},
}