Revert "Chore: Apply clippy map transformations"
This reverts commit c997aad85d.
This commit is contained in:
parent
76873921af
commit
b277625546
7 changed files with 15 additions and 10 deletions
|
|
@ -69,6 +69,8 @@ impl Click {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.position == new_position
|
self.position == new_position
|
||||||
&& duration.is_some_and(|duration| duration.as_millis() <= 300)
|
&& duration
|
||||||
|
.map(|duration| duration.as_millis() <= 300)
|
||||||
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,10 +200,8 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
viewport.scale_factor(),
|
viewport.scale_factor(),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.map_or(
|
.map(mouse::Cursor::Available)
|
||||||
mouse::Cursor::Unavailable,
|
.unwrap_or(mouse::Cursor::Unavailable),
|
||||||
mouse::Cursor::Available,
|
|
||||||
),
|
|
||||||
&mut renderer,
|
&mut renderer,
|
||||||
&Theme::Dark,
|
&Theme::Dark,
|
||||||
&renderer::Style {
|
&renderer::Style {
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,10 @@ fn numeric_input(
|
||||||
) -> Element<'_, Option<u32>> {
|
) -> Element<'_, Option<u32>> {
|
||||||
text_input(
|
text_input(
|
||||||
placeholder,
|
placeholder,
|
||||||
&value.as_ref().map_or_else(String::new, ToString::to_string),
|
&value
|
||||||
|
.as_ref()
|
||||||
|
.map(ToString::to_string)
|
||||||
|
.unwrap_or_else(String::new),
|
||||||
)
|
)
|
||||||
.on_input(move |text| {
|
.on_input(move |text| {
|
||||||
if text.is_empty() {
|
if text.is_empty() {
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ impl Cache {
|
||||||
.ok()
|
.ok()
|
||||||
});
|
});
|
||||||
|
|
||||||
tree.map_or(Svg::NotFound, Svg::Loaded)
|
tree.map(Svg::Loaded).unwrap_or(Svg::NotFound)
|
||||||
}
|
}
|
||||||
svg::Data::Bytes(bytes) => {
|
svg::Data::Bytes(bytes) => {
|
||||||
match usvg::Tree::from_data(bytes, &usvg::Options::default()) {
|
match usvg::Tree::from_data(bytes, &usvg::Options::default()) {
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,7 @@ fn multisample_state(
|
||||||
antialiasing: Option<Antialiasing>,
|
antialiasing: Option<Antialiasing>,
|
||||||
) -> wgpu::MultisampleState {
|
) -> wgpu::MultisampleState {
|
||||||
wgpu::MultisampleState {
|
wgpu::MultisampleState {
|
||||||
count: antialiasing.map_or(1, Antialiasing::sample_count),
|
count: antialiasing.map(|a| a.sample_count()).unwrap_or(1),
|
||||||
mask: !0,
|
mask: !0,
|
||||||
alpha_to_coverage_enabled: false,
|
alpha_to_coverage_enabled: false,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,8 @@ where
|
||||||
self.viewport.scale_factor(),
|
self.viewport.scale_factor(),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.map_or(mouse::Cursor::Unavailable, mouse::Cursor::Available)
|
.map(mouse::Cursor::Available)
|
||||||
|
.unwrap_or(mouse::Cursor::Unavailable)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the current keyboard modifiers of the [`State`].
|
/// Returns the current keyboard modifiers of the [`State`].
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ impl Clipboard {
|
||||||
pub fn connect(window: &winit::window::Window) -> Clipboard {
|
pub fn connect(window: &winit::window::Window) -> Clipboard {
|
||||||
let state = window_clipboard::Clipboard::connect(window)
|
let state = window_clipboard::Clipboard::connect(window)
|
||||||
.ok()
|
.ok()
|
||||||
.map_or(State::Unavailable, State::Connected);
|
.map(State::Connected)
|
||||||
|
.unwrap_or(State::Unavailable);
|
||||||
|
|
||||||
Clipboard { state }
|
Clipboard { state }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue