georust / geo

Rust geospatial primitives & algorithms
https://crates.io/crates/geo
Other
1.58k stars 199 forks source link

[traits] rename CoordTrait::nth_unchecked -> nth_or_panic to match conventional semantics #1242

Closed michaelkirk closed 3 weeks ago

michaelkirk commented 3 weeks ago

unchecked implies it's an unsafe method, like Vec::get_unsafe. It's how we use the term elsewhere in this api, e.g. see this discussion https://github.com/georust/geojson/pull/245#discussion_r1821255299

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.

michaelkirk commented 3 weeks ago

I've restored nth_unchecked, marked it unsafe and by default it just calls nth_or_panic.

Please take another look.