summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/screenshot/src/main.rs6
-rw-r--r--examples/toast/src/main.rs2
-rw-r--r--examples/todos/src/main.rs2
-rw-r--r--examples/visible_bounds/src/main.rs20
4 files changed, 14 insertions, 16 deletions
diff --git a/examples/screenshot/src/main.rs b/examples/screenshot/src/main.rs
index c5fe3004..64aa1a7a 100644
--- a/examples/screenshot/src/main.rs
+++ b/examples/screenshot/src/main.rs
@@ -228,8 +228,8 @@ impl Application for Example {
if let Some(png_result) = &self.saved_png_path {
let msg = match png_result {
Ok(path) => format!("Png saved as: {path:?}!"),
- Err(msg) => {
- format!("Png could not be saved due to:\n{msg:?}")
+ Err(PngError(error)) => {
+ format!("Png could not be saved due to:\n{}", error)
}
};
@@ -283,7 +283,7 @@ async fn save_to_png(screenshot: Screenshot) -> Result<String, PngError> {
ColorType::Rgba8,
)
.map(|_| path)
- .map_err(|err| PngError(format!("{err:?}")))
+ .map_err(|error| PngError(error.to_string()))
})
.await
.expect("Blocking task to finish")
diff --git a/examples/toast/src/main.rs b/examples/toast/src/main.rs
index af29660a..7f067e2f 100644
--- a/examples/toast/src/main.rs
+++ b/examples/toast/src/main.rs
@@ -332,7 +332,7 @@ mod toast {
}
fn tag(&self) -> widget::tree::Tag {
- struct Marker(Vec<Instant>);
+ struct Marker;
widget::tree::Tag::of::<Marker>()
}
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 88c4c2b4..eae127f7 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -152,7 +152,7 @@ impl Application for Todos {
Command::none()
}
}
- Message::Saved(_) => {
+ Message::Saved(_result) => {
state.saving = false;
saved = true;
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),
]