mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
kittest: Format errors with Display (#7569)
This commit is contained in:
@@ -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}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user