Skip to content

Commit 6afdfbb

Browse files
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
1 parent 843bee2 commit 6afdfbb

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arrow-buffer/src/builder/boolean.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ impl BooleanBufferBuilder {
140140

141141
/// Reserve space to at least `additional` new bits.
142142
/// Capacity will be `>= self.len() + additional`.
143-
/// New bytes are uninitialized and reading them is undefined behavior.
144143
#[inline]
145144
pub fn reserve(&mut self, additional: usize) {
146145
let capacity = self.len + additional;

0 commit comments

Comments
 (0)