Skip to content

Commit

Permalink
Fix new beta toolchain warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 4, 2024
1 parent 8792fc0 commit e14e8e2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
6 changes: 3 additions & 3 deletions examples/screenshot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
};

Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion examples/toast/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ mod toast {
}

fn tag(&self) -> widget::tree::Tag {
struct Marker(Vec<Instant>);
struct Marker;
widget::tree::Tag::of::<Marker>()
}

Expand Down
2 changes: 1 addition & 1 deletion examples/todos/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl Application for Todos {
Command::none()
}
}
Message::Saved(_) => {
Message::Saved(_result) => {
state.saving = false;
saved = true;

Expand Down
20 changes: 9 additions & 11 deletions examples/visible_bounds/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct Example {
enum Message {
MouseMoved(Point),
WindowResized,
Scrolled(scrollable::Viewport),
Scrolled,
OuterBoundsFetched(Option<Rectangle>),
InnerBoundsFetched(Option<Rectangle>),
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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),
]
Expand Down

0 comments on commit e14e8e2

Please sign in to comment.