emilk opened a new pull request, #10656:
URL: https://github.com/apache/arrow-rs/pull/10656
# Which issue does this PR close?
None; docs-only cleanup found while reading `arrow-array`.
# Rationale for this change
Many public functions panic on bad arguments (out-of-bounds indexes, zero
divisors, wrong array type) without a `# Panics` section, so callers cannot
tell from the docs which functions are fallible-by-panic. Nine functions also
spelled the header `# Panic`, which no search for `# Panics` finds.
# What changes are included in this PR?
Docs only, no code changes. Adds `# Panics` to public functions that panic
on bad arguments or bad state:
- **arrow-buffer**: `NullBuffer::{is_valid, is_null, slice, expand}`,
`BooleanBuffer::slice`, `ScalarBuffer::slice`, `OffsetBuffer`,
`Buffer::bit_slice`, `bit_util`, `bit_mask::set_bits`, bitmap builders, `i256`
division and logarithms
- **arrow-array**: `Array::{is_null, is_valid, slice}` and all inherent
`slice`s, index accessors (`value_length`, `value_size`, `value_offset`,
`column`, `key`, `value_as_*`), `cast.rs` downcast helpers, builder
`finish`/`finish_cloned`, `make_builder`, deprecated `Date32Type` interval
helpers, `div_wrapping`/`mod_wrapping`
- **arrow-data**, **arrow-schema**: FFI schema accessors
- **arrow-ord**, **arrow-row**, **arrow-cast**: `compare_byte_view`,
`Rows::{push, row}`, `b64_encode`
- **arrow**: bench and test helpers that assert on their arguments
- **parquet**: `ByteArray` accessors, `Sbbf::new_with_num_of_bytes`,
`byte_range`, `with_range`, truncate-length setters, typed column reader/writer
casts, `schema::types` accessors
- **parquet-variant**: infallible constructors (several had no docs at all),
`get`, `iter`, `get_entry`, `ObjectBuilder::{new_object, new_list}`
Also normalizes `# Panic` to `# Panics` and converts loose "this will panic
if ..." prose into proper sections.
Left alone deliberately: `unreachable!` on invalid *self* state,
private/`pub(crate)` modules, `debug_assert` sites, and notes about *other*
functions panicking.
# Are these changes tested?
No new tests; docs only. `cargo clippy --workspace --all-features
--all-targets` and `cargo doc --workspace --all-features` are clean, with no
new rustdoc warnings against the baseline, and doctests pass.
# Are there any user-facing changes?
Documentation only. No API changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]