mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -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:
@@ -382,7 +382,7 @@ impl Path {
|
||||
|
||||
pub fn add_open_points(&mut self, points: &[Pos2]) {
|
||||
let n = points.len();
|
||||
assert!(n >= 2);
|
||||
assert!(n >= 2, "A path needs at least two points, but got {n}");
|
||||
|
||||
if n == 2 {
|
||||
// Common case optimization:
|
||||
@@ -428,7 +428,7 @@ impl Path {
|
||||
|
||||
pub fn add_line_loop(&mut self, points: &[Pos2]) {
|
||||
let n = points.len();
|
||||
assert!(n >= 2);
|
||||
assert!(n >= 2, "A path needs at least two points, but got {n}");
|
||||
self.reserve(n);
|
||||
|
||||
let mut n0 = (points[0] - points[n - 1]).normalized().rot90();
|
||||
|
||||
Reference in New Issue
Block a user