This is an automated email from the ASF dual-hosted git repository.
jeffreyvo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 6afdfbbe28 docs: fix misleading reserve documentation (#9076)
6afdfbbe28 is described below
commit 6afdfbbe28718e0d186318e0c8d12d29ede9875f
Author: WaterWhisperer <[email protected]>
AuthorDate: Thu Jan 1 23:18:23 2026 +0800
docs: fix misleading reserve documentation (#9076)
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->
- Closes #7236
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
The previous documentation for `BooleanBufferBuilder::reserve` mentioned
that reading new bytes is undefined behavior. However, as noted in the
issue, the safe APIs only expose initialized slices, making this warning
misleading.
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
- Remove misleading UB warning from `BooleanBufferBuilder::reserve`.
- Unify documentation for the `reserve` methods to follow a consistent
format.
# Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
No, because it's doc change
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
If there are any breaking changes to public APIs, please call them out.
-->
Yes
---
arrow-buffer/src/builder/boolean.rs | 1 -
1 file changed, 1 deletion(-)
diff --git a/arrow-buffer/src/builder/boolean.rs
b/arrow-buffer/src/builder/boolean.rs
index 512f729fda..41a75ef3e2 100644
--- a/arrow-buffer/src/builder/boolean.rs
+++ b/arrow-buffer/src/builder/boolean.rs
@@ -140,7 +140,6 @@ impl BooleanBufferBuilder {
/// Reserve space to at least `additional` new bits.
/// Capacity will be `>= self.len() + additional`.
- /// New bytes are uninitialized and reading them is undefined behavior.
#[inline]
pub fn reserve(&mut self, additional: usize) {
let capacity = self.len + additional;