summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2023-09-19 13:22:21 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-19 13:22:21 +0200
commit582da10ae2465a7a65ea062347b8f14fba8e6064 (patch)
treee4be970e1f7614e79e5303a391b77858cc03121e /examples
parenta4dbf0788716e8b83a9f37963ef685b765a326c6 (diff)
parentc997aad85d7ee6e77085e50e5e599002549d228f (diff)
downloadiced-582da10ae2465a7a65ea062347b8f14fba8e6064.tar.gz
iced-582da10ae2465a7a65ea062347b8f14fba8e6064.tar.bz2
iced-582da10ae2465a7a65ea062347b8f14fba8e6064.zip
Merge pull request #2090 from nyurik/mapping
Chore: Apply clippy map transformations
Diffstat (limited to 'examples')
-rw-r--r--examples/integration/src/main.rs6
-rw-r--r--examples/screenshot/src/main.rs5
2 files changed, 5 insertions, 6 deletions
diff --git a/examples/integration/src/main.rs b/examples/integration/src/main.rs
index 7945bd20..243297b2 100644
--- a/examples/integration/src/main.rs
+++ b/examples/integration/src/main.rs
@@ -200,8 +200,10 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
viewport.scale_factor(),
)
})
- .map(mouse::Cursor::Available)
- .unwrap_or(mouse::Cursor::Unavailable),
+ .map_or(
+ mouse::Cursor::Unavailable,
+ mouse::Cursor::Available,
+ ),
&mut renderer,
&Theme::Dark,
&renderer::Style {
diff --git a/examples/screenshot/src/main.rs b/examples/screenshot/src/main.rs
index 1c9e187c..d9784dc8 100644
--- a/examples/screenshot/src/main.rs
+++ b/examples/screenshot/src/main.rs
@@ -293,10 +293,7 @@ fn numeric_input(
) -> Element<'_, Option<u32>> {
text_input(
placeholder,
- &value
- .as_ref()
- .map(ToString::to_string)
- .unwrap_or_else(String::new),
+ &value.as_ref().map_or_else(String::new, ToString::to_string),
)
.on_input(move |text| {
if text.is_empty() {