Skip to content

Commit 03fb443

Browse files
committed
Only update snapshot if we didn't pass (#7455)
* Closes #7449
1 parent d739a4b commit 03fb443

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/egui_kittest/src/snapshot.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,13 @@ fn try_image_snapshot_options_impl(
412412
err,
413413
})?;
414414

415+
if num_wrong_pixels as i64 <= *failed_pixel_count_threshold as i64 {
416+
return Ok(());
417+
}
418+
415419
if should_update_snapshots() {
416420
update_snapshot()
417421
} else {
418-
if num_wrong_pixels as i64 <= *failed_pixel_count_threshold as i64 {
419-
return Ok(());
420-
}
421-
422422
Err(SnapshotError::Diff {
423423
name,
424424
diff: num_wrong_pixels,

0 commit comments

Comments
 (0)