1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Add assert messages and print bad argument values in asserts (#5216)

Enabled the `missing_assert_message` lint

* [x] I have followed the instructions in the PR template

---------

Co-authored-by: Lucas Meurer <lucasmeurer96@gmail.com>
This commit is contained in:
Nicolas
2025-03-25 09:20:29 +01:00
committed by GitHub
parent 903bd81313
commit 58b2ac88c0
35 changed files with 331 additions and 108 deletions

View File

@@ -339,7 +339,7 @@ impl Shape {
#[inline]
pub fn mesh(mesh: impl Into<Arc<Mesh>>) -> Self {
let mesh = mesh.into();
debug_assert!(mesh.is_valid());
debug_assert!(mesh.is_valid(), "Invalid mesh: {mesh:#?}");
Self::Mesh(mesh)
}
@@ -525,7 +525,13 @@ fn dashes_from_line(
shapes: &mut Vec<Shape>,
dash_offset: f32,
) {
assert_eq!(dash_lengths.len(), gap_lengths.len());
assert_eq!(
dash_lengths.len(),
gap_lengths.len(),
"Mismatched dash and gap lengths, got dash_lengths: {}, gap_lengths: {}",
dash_lengths.len(),
gap_lengths.len()
);
let mut position_on_segment = dash_offset;
let mut drawing_dash = false;
let mut step = 0;