-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[traits] rename CoordTrait::nth_unchecked -> nth_or_panic to match conventional semantics #1242
Conversation
a080163
to
bc5815e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there also be an actually unsafe nth_unchecked
that doesn't even do a bounds check? (I don't know; I don't usually use any unchecked variants)
I've restored Please take another look. |
/// | ||
/// See also [`nth_or_panic()`](Self::nth_or_panic) and [`nth_unchecked()`](Self::nth_unchecked). | ||
/// | ||
/// # Panics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a panic condition.
20a6db5
to
d6d357d
Compare
…nventional semantics `unchecked` implies it's an unsafe method, like `Vec::get_unsafe` Also cleaned up some stale docs.
d6d357d
to
8fa9776
Compare
CHANGES.md
if knowledge of this change could be valuable to users.unchecked
implies it's an unsafe method, likeVec::get_unsafe
. It's how we use the term elsewhere in this api, e.g. see this discussion georust/geojson#245 (comment)I also cleaned up some stale docs.
I opted not to add
foo_or_panic
methods to the various collections in this PR, as it seemed like a slightly different issue that could be followed up separately.