I've spotted, that remove() panic message could've provided details on what values led to this panic, instead of mentioning condition only. Generally speaking this and some other assert!s in Vec could've been more detailed. If it's okay to step in, I'd like to offer my help.
In case of remove I'd suggest calling this instead
assert!(index < len, "removal index {} should be less than length {}", index, len);
I find this more informative than assertion failed: index < len
Candidates for improval:
aforementioned remove:
insert:
drain:
|
assert!(start <= end); |
|
assert!(end <= len); |
split_off:
|
assert!(at <= self.len(), "`at` out of bounds"); |
I've spotted, that
remove()panic message could've provided details on what values led to this panic, instead of mentioning condition only. Generally speaking this and some otherassert!s in Vec could've been more detailed. If it's okay to step in, I'd like to offer my help.In case of
removeI'd suggest calling this insteadI find this more informative than
assertion failed: index < lenCandidates for improval:
aforementioned
remove:rust/src/liballoc/vec.rs
Line 1034 in 5f13820
insert:rust/src/liballoc/vec.rs
Line 994 in 5f13820
drain:rust/src/liballoc/vec.rs
Lines 1292 to 1293 in 5f13820
split_off:rust/src/liballoc/vec.rs
Line 1383 in 5f13820