Fix new beta toolchain warnings

This commit is contained in:
Héctor Ramón Jiménez 2024-02-05 00:51:51 +01:00
parent 8792fc0bb7
commit e14e8e2e9a
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 14 additions and 16 deletions

View file

@ -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")