Fix new beta toolchain warnings
This commit is contained in:
parent
8792fc0bb7
commit
e14e8e2e9a
4 changed files with 14 additions and 16 deletions
|
|
@ -228,8 +228,8 @@ impl Application for Example {
|
||||||
if let Some(png_result) = &self.saved_png_path {
|
if let Some(png_result) = &self.saved_png_path {
|
||||||
let msg = match png_result {
|
let msg = match png_result {
|
||||||
Ok(path) => format!("Png saved as: {path:?}!"),
|
Ok(path) => format!("Png saved as: {path:?}!"),
|
||||||
Err(msg) => {
|
Err(PngError(error)) => {
|
||||||
format!("Png could not be saved due to:\n{msg:?}")
|
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,
|
ColorType::Rgba8,
|
||||||
)
|
)
|
||||||
.map(|_| path)
|
.map(|_| path)
|
||||||
.map_err(|err| PngError(format!("{err:?}")))
|
.map_err(|error| PngError(error.to_string()))
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.expect("Blocking task to finish")
|
.expect("Blocking task to finish")
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,7 @@ mod toast {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tag(&self) -> widget::tree::Tag {
|
fn tag(&self) -> widget::tree::Tag {
|
||||||
struct Marker(Vec<Instant>);
|
struct Marker;
|
||||||
widget::tree::Tag::of::<Marker>()
|
widget::tree::Tag::of::<Marker>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ impl Application for Todos {
|
||||||
Command::none()
|
Command::none()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message::Saved(_) => {
|
Message::Saved(_result) => {
|
||||||
state.saving = false;
|
state.saving = false;
|
||||||
saved = true;
|
saved = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ struct Example {
|
||||||
enum Message {
|
enum Message {
|
||||||
MouseMoved(Point),
|
MouseMoved(Point),
|
||||||
WindowResized,
|
WindowResized,
|
||||||
Scrolled(scrollable::Viewport),
|
Scrolled,
|
||||||
OuterBoundsFetched(Option<Rectangle>),
|
OuterBoundsFetched(Option<Rectangle>),
|
||||||
InnerBoundsFetched(Option<Rectangle>),
|
InnerBoundsFetched(Option<Rectangle>),
|
||||||
}
|
}
|
||||||
|
|
@ -58,14 +58,12 @@ impl Application for Example {
|
||||||
|
|
||||||
Command::none()
|
Command::none()
|
||||||
}
|
}
|
||||||
Message::Scrolled(_) | Message::WindowResized => {
|
Message::Scrolled | Message::WindowResized => Command::batch(vec![
|
||||||
Command::batch(vec![
|
container::visible_bounds(OUTER_CONTAINER.clone())
|
||||||
container::visible_bounds(OUTER_CONTAINER.clone())
|
.map(Message::OuterBoundsFetched),
|
||||||
.map(Message::OuterBoundsFetched),
|
container::visible_bounds(INNER_CONTAINER.clone())
|
||||||
container::visible_bounds(INNER_CONTAINER.clone())
|
.map(Message::InnerBoundsFetched),
|
||||||
.map(Message::InnerBoundsFetched),
|
]),
|
||||||
])
|
|
||||||
}
|
|
||||||
Message::OuterBoundsFetched(outer_bounds) => {
|
Message::OuterBoundsFetched(outer_bounds) => {
|
||||||
self.outer_bounds = outer_bounds;
|
self.outer_bounds = outer_bounds;
|
||||||
|
|
||||||
|
|
@ -147,13 +145,13 @@ impl Application for Example {
|
||||||
]
|
]
|
||||||
.padding(20)
|
.padding(20)
|
||||||
)
|
)
|
||||||
.on_scroll(Message::Scrolled)
|
.on_scroll(|_| Message::Scrolled)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.height(300),
|
.height(300),
|
||||||
]
|
]
|
||||||
.padding(20)
|
.padding(20)
|
||||||
)
|
)
|
||||||
.on_scroll(Message::Scrolled)
|
.on_scroll(|_| Message::Scrolled)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.height(300),
|
.height(300),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue