summaryrefslogtreecommitdiffstats
path: root/examples/visible_bounds
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-05 00:51:51 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-05 00:51:51 +0100
commite14e8e2e9acc7fb8debb7881d8891be5c3a13bd0 (patch)
tree691e7d930829890b84423f592a4405742a7766d8 /examples/visible_bounds
parent8792fc0bb731e71b4552a90449f3c38a858b50b1 (diff)
downloadiced-e14e8e2e9acc7fb8debb7881d8891be5c3a13bd0.tar.gz
iced-e14e8e2e9acc7fb8debb7881d8891be5c3a13bd0.tar.bz2
iced-e14e8e2e9acc7fb8debb7881d8891be5c3a13bd0.zip
Fix new `beta` toolchain warnings
Diffstat (limited to 'examples/visible_bounds')
-rw-r--r--examples/visible_bounds/src/main.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/examples/visible_bounds/src/main.rs b/examples/visible_bounds/src/main.rs
index fdf1e0f9..33d76da8 100644
--- a/examples/visible_bounds/src/main.rs
+++ b/examples/visible_bounds/src/main.rs
@@ -25,7 +25,7 @@ struct Example {
enum Message {
MouseMoved(Point),
WindowResized,
- Scrolled(scrollable::Viewport),
+ Scrolled,
OuterBoundsFetched(Option<Rectangle>),
InnerBoundsFetched(Option<Rectangle>),
}
@@ -58,14 +58,12 @@ impl Application for Example {
Command::none()
}
- Message::Scrolled(_) | Message::WindowResized => {
- Command::batch(vec![
- container::visible_bounds(OUTER_CONTAINER.clone())
- .map(Message::OuterBoundsFetched),
- container::visible_bounds(INNER_CONTAINER.clone())
- .map(Message::InnerBoundsFetched),
- ])
- }
+ Message::Scrolled | Message::WindowResized => Command::batch(vec![
+ container::visible_bounds(OUTER_CONTAINER.clone())
+ .map(Message::OuterBoundsFetched),
+ container::visible_bounds(INNER_CONTAINER.clone())
+ .map(Message::InnerBoundsFetched),
+ ]),
Message::OuterBoundsFetched(outer_bounds) => {
self.outer_bounds = outer_bounds;
@@ -147,13 +145,13 @@ impl Application for Example {
]
.padding(20)
)
- .on_scroll(Message::Scrolled)
+ .on_scroll(|_| Message::Scrolled)
.width(Length::Fill)
.height(300),
]
.padding(20)
)
- .on_scroll(Message::Scrolled)
+ .on_scroll(|_| Message::Scrolled)
.width(Length::Fill)
.height(300),
]