Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make extend_vec_zeroed, insert_vec_zeroed fallible #1658

Merged
merged 1 commit into from
Sep 15, 2024
Merged

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Sep 15, 2024

They now return AllocError on allocation failure. insert_vec_zeroed still panics if its position argument is out-of-bounds.

Closes #1653

They now return `AllocError` on allocation failure. `insert_vec_zeroed`
still panics if its `position` argument is out-of-bounds.

This requires using `Vec::try_reserve`, which is unstable before 1.57.0.
Since our MSRV is currently 1.56.0, these functions are now
conditionally compiled and only available on 1.57.0 and later.

Closes #1653
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.01%. Comparing base (f998114) to head (21d63a2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1658   +/-   ##
=======================================
  Coverage   88.00%   88.01%           
=======================================
  Files          16       16           
  Lines        5801     5805    +4     
=======================================
+ Hits         5105     5109    +4     
  Misses        696      696           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joshlf joshlf added this pull request to the merge queue Sep 15, 2024
Merged via the queue into main with commit 0003184 Sep 15, 2024
74 checks passed
@joshlf joshlf deleted the fallible-allocation branch September 15, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make extend_vec_zeroed and insert_vec_zeroed fallible
3 participants