kittest: Format errors with `Display` (#7569)

This commit is contained in:
Emil Ernerfeldt 2025-09-30 08:24:21 +02:00 committed by GitHub
parent e9898e4932
commit 5ee88da61c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -250,7 +250,7 @@ impl Display for SnapshotError {
err => { err => {
write!( write!(
f, f,
"Error reading snapshot: {err:?}\nAt: {}. {HOW_TO_UPDATE_SCREENSHOTS}", "Error reading snapshot: {err}\nAt: {}. {HOW_TO_UPDATE_SCREENSHOTS}",
path.display() path.display()
) )
} }
@ -258,7 +258,7 @@ impl Display for SnapshotError {
err => { err => {
write!( write!(
f, f,
"Error decoding snapshot: {err:?}\nAt: {}. Make sure git-lfs is setup correctly. Read the instructions here: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md#making-a-pr", "Error decoding snapshot: {err}\nAt: {}. Make sure git-lfs is setup correctly. Read the instructions here: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md#making-a-pr",
path.display() path.display()
) )
} }
@ -276,10 +276,10 @@ impl Display for SnapshotError {
} }
Self::WriteSnapshot { path, err } => { Self::WriteSnapshot { path, err } => {
let path = std::path::absolute(path).unwrap_or(path.clone()); let path = std::path::absolute(path).unwrap_or(path.clone());
write!(f, "Error writing snapshot: {err:?}\nAt: {}", path.display()) write!(f, "Error writing snapshot: {err}\nAt: {}", path.display())
} }
Self::RenderError { err } => { Self::RenderError { err } => {
write!(f, "Error rendering image: {err:?}") write!(f, "Error rendering image: {err}")
} }
} }
} }

View File

@ -206,7 +206,7 @@ impl crate::TestRenderer for WgpuTestRenderer {
self.render_state self.render_state
.device .device
.poll(wgpu::PollType::Wait) .poll(wgpu::PollType::Wait)
.map_err(|e| format!("{e:?}"))?; .map_err(|err| format!("PollError: {err}"))?;
Ok(texture_to_image( Ok(texture_to_image(
&self.render_state.device, &self.render_state.device,