Skip to content

chore: update Bytes visibility to correctly reflect the actual visibility - #10115

Merged
alamb merged 2 commits into
apache:mainfrom
rluvaton:update-vis
Jun 11, 2026
Merged

alamb merged 2 commits into
apache:mainfrom
rluvaton:update-vis

Conversation

@rluvaton

Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A

Rationale for this change

although Bytes and some of its functions are marked as pub it is never exposed outside the crate.
updated this so reading the code will be less confusing

What changes are included in this PR?

changed pub to pub(crate) in Bytes impl

Are these changes tested?

existing tests

Are there any user-facing changes?

no since it was never exposed anyway

visibility

although `Bytes` and some of its functions are marked as `pub` it is
never exposed outside the crate.
updated this so reading the code will be less confusing
@github-actions github-actions Bot added the arrow Changes to the arrow crate label Jun 11, 2026
Comment thread arrow-buffer/src/bytes.rs
Comment on lines -97 to -99
pub fn is_empty(&self) -> bool {
self.len == 0
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused and when changed to pub(crate) lint failed

@etseidl etseidl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems rational, thanks. I feel the pain of trying to figure out which APIs are actually public.

@rluvaton

Copy link
Copy Markdown
Member Author

Can you please merge :)

@etseidl

etseidl commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Can you please merge :)

I'll merge tomorrow if no one objects by then. I don't venture into this part of the code base much.

cc @alamb @Dandandan

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me and I have hit this thing several times as well

Thank you @rluvaton and @etseidl

Comment thread arrow-buffer/src/bytes.rs
/// custom deallocator to deallocate the region when it is no longer needed.
///
pub struct Bytes {
pub(crate) struct Bytes {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamb
alamb merged commit 8d2333c into apache:main Jun 11, 2026
27 checks passed
@rluvaton
rluvaton deleted the update-vis branch June 11, 2026 22:22
Jefffrey added a commit that referenced this pull request Oct 22, 2026
…:shrink_to_fit when MemoryReservation::resize panics (#11786)

- Backport #10932
- For inclusion in #11666

Cherry-pick of
9a8400e

Conflicts resolved by hand:
- `arrow-buffer/src/buffer/immutable.rs`: kept the nested `if let` form
instead of let-chains (57's MSRV is 1.85); dropped two unrelated
`into_mutable` tests that the conflict region pulled in from main,
keeping only the new `test_shrink_to_fit_panicking_reservation`
- `arrow-buffer/src/bytes.rs`: `Bytes::try_realloc` is still `pub` on
this branch (it was changed to `pub(crate)` on main by #10115); kept it
`pub`. `Bytes` lives in a private module so this is not a public API
change.

Co-authored-by: RIchard Baah <[email protected]>
Co-authored-by: Jeffrey Vo <[email protected]>
Jefffrey added a commit that referenced this pull request Oct 22, 2026
…:shrink_to_fit when MemoryReservation::resize panics (#11785)

- Backport #10932
- For inclusion in #11665

Cherry-pick of
9a8400e

Conflicts resolved by hand:
- `arrow-buffer/src/buffer/immutable.rs`: kept the nested `if let` form
instead of let-chains (58's MSRV is 1.85)
- `arrow-buffer/src/bytes.rs`: `Bytes::try_realloc` is still `pub` on
this branch (it was changed to `pub(crate)` on main by #10115); kept it
`pub`. `Bytes` lives in a private module so this is not a public API
change.

Co-authored-by: RIchard Baah <[email protected]>
Co-authored-by: Jeffrey Vo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants