diff options
author | 2023-09-19 01:31:10 -0400 | |
---|---|---|
committer | 2023-09-19 01:32:56 -0400 | |
commit | 3d6b9637c3b1c9f3c654a3ecef7a247cfd6edef3 (patch) | |
tree | 70ffb135b91c824caa37a0fe4742179088e5a638 /examples/screenshot | |
parent | 4613eb26cba3ded83f25ebdefd01c983c79a9d59 (diff) | |
download | iced-3d6b9637c3b1c9f3c654a3ecef7a247cfd6edef3.tar.gz iced-3d6b9637c3b1c9f3c654a3ecef7a247cfd6edef3.tar.bz2 iced-3d6b9637c3b1c9f3c654a3ecef7a247cfd6edef3.zip |
Chore: Inline format args for ease of reading
A minor cleanup to inline all simple cases of format arguments. Makes the format strings just a bit easier to read.
Diffstat (limited to 'examples/screenshot')
-rw-r--r-- | examples/screenshot/src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/screenshot/src/main.rs b/examples/screenshot/src/main.rs index 68c9d031..1c9e187c 100644 --- a/examples/screenshot/src/main.rs +++ b/examples/screenshot/src/main.rs @@ -184,8 +184,8 @@ impl Application for Example { .align_items(Alignment::Center); if let Some(crop_error) = &self.crop_error { - crop_controls = crop_controls - .push(text(format!("Crop error! \n{}", crop_error))); + crop_controls = + crop_controls.push(text(format!("Crop error! \n{crop_error}"))); } let mut controls = column![ @@ -221,9 +221,9 @@ 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), + Ok(path) => format!("Png saved as: {path:?}!"), Err(msg) => { - format!("Png could not be saved due to:\n{:?}", msg) + format!("Png could not be saved due to:\n{msg:?}") } }; @@ -281,7 +281,7 @@ async fn save_to_png(screenshot: Screenshot) -> Result<String, PngError> { ColorType::Rgba8, ) .map(|_| path) - .map_err(|err| PngError(format!("{:?}", err))) + .map_err(|err| PngError(format!("{err:?}"))) } #[derive(Clone, Debug)] |