Skip to content

replace more mutablebuffer callsites with fallible methods #11900

Description

@Jefffrey

Is your feature request related to a problem or challenge?

when poking around investigating a separate issue i noticed some places we still use panicky versions of MutableBuffer methods even inside a fallible method, see examples of from_len_zeroed:

pub fn try_new_zeroed(len: usize) -> Result<Self, OverflowError> {
let len_bytes = len
.checked_add(1)
.and_then(|o| o.checked_mul(std::mem::size_of::<O>()))
.ok_or_else(|| OverflowError::new::<usize>("buffer length"))?;
let buffer = MutableBuffer::from_len_zeroed(len_bytes);
Ok(Self(buffer.into_buffer().into()))
}

  • though this is a bit tricky since the error is OverflowError 🤔

let null_buffer = use_nulls.then(|| {
let null_bytes = bit_util::ceil(array_capacity, 8);
MutableBuffer::from_len_zeroed(null_bytes)
});

Describe the solution you'd like

we should replace the above with the fallible version if possible. we should also do a further audit to see where else we are using the panicky method instead of the fallible version, not only for from_len_zeroed but for other methods of mutablebuffer

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. added
    enhancement
    on Oct 25, 2026
  2. added theissue type on Oct 25, 2026
  3. Jefffrey commented on Oct 25, 2026

    @Jefffrey
    ContributorAuthor
  4. Rich-T-kid commented on Oct 25, 2026

    @Rich-T-kid
    Contributor

    yeah I can look into this. should be easy enough to have ai do a search and replace

  5. Rich-T-kid commented on Oct 25, 2026

    @Rich-T-kid
    Contributor

    take

  6. added a commit that references this issue on Nov 19, 2026
    44a4bdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions