Chore: Apply clippy map transformations

Convert `.map().unwrap_or()` to `.map_or()` and similar transformations.
This commit is contained in:
Yuri Astrakhan 2023-09-19 01:46:46 -04:00
parent 4613eb26cb
commit c997aad85d
7 changed files with 10 additions and 15 deletions

View file

@ -56,7 +56,7 @@ impl Cache {
.ok()
});
tree.map(Svg::Loaded).unwrap_or(Svg::NotFound)
tree.map_or(Svg::NotFound, Svg::Loaded)
}
svg::Data::Bytes(bytes) => {
match usvg::Tree::from_data(bytes, &usvg::Options::default()) {

View file

@ -349,7 +349,7 @@ fn multisample_state(
antialiasing: Option<Antialiasing>,
) -> wgpu::MultisampleState {
wgpu::MultisampleState {
count: antialiasing.map(|a| a.sample_count()).unwrap_or(1),
count: antialiasing.map_or(1, Antialiasing::sample_count),
mask: !0,
alpha_to_coverage_enabled: false,
}