-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
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
:
Line 1034 in 5f13820
assert!(index < len); |
insert
:
Line 994 in 5f13820
assert!(index <= len); |
drain
:
Lines 1292 to 1293 in 5f13820
assert!(start <= end); | |
assert!(end <= len); |
split_off
:
Line 1383 in 5f13820
assert!(at <= self.len(), "`at` out of bounds"); |
Luro02
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.