Add assert messages and print bad argument values in asserts#5216
Add assert messages and print bad argument values in asserts#5216lucasmerlin merged 5 commits intoemilk:masterfrom
Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/5216-patch17 |
|
@lucasmerlin could you have a look at it? |
emilk
left a comment
There was a problem hiding this comment.
Thanks for working on this (and sorry for the slow review). I think if we do this we should go all the way and also include printing the bad argument value (where it makes sense).
crates/egui/src/ui.rs
Outdated
| debug_assert!(desired_size.x >= 0.0 && desired_size.y >= 0.0); | ||
| debug_assert!( | ||
| desired_size.x >= 0.0 && desired_size.y >= 0.0, | ||
| "desired_size should be positive" |
There was a problem hiding this comment.
Most of these would be a lot more useful if we printed the value that was wrong:
| "desired_size should be positive" | |
| "desired_size should be positive, got {desired_size:?}" |
here and (almost) everywhere
|
@emilk restarted the PR |
lucasmerlin
left a comment
There was a problem hiding this comment.
Awesome, thank you for re-doing this!
missing_assert_message lintCo-authored-by: Lucas Meurer <[email protected]>
Co-authored-by: Lucas Meurer <[email protected]>
Co-authored-by: Lucas Meurer <[email protected]>
Co-authored-by: Lucas Meurer <[email protected]>
|
@lucasmerlin fixed the rest |
|
No worries! |
) Enabled the `missing_assert_message` lint * [x] I have followed the instructions in the PR template --------- Co-authored-by: Lucas Meurer <[email protected]>
Enabled the
missing_assert_messagelint