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 extract_requirement_version return an Option #294

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Nov 28, 2024

Rust 1.83 added support for Option::expect in const contexts:
https://blog.rust-lang.org/2024/11/28/Rust-1.83.0.html#stabilized-apis

This means we can now return an Option from extract_requirement_version instead of panicing within it, which makes it easier to test the function, and avoids the need to explain that the panic inside the function was actually safe.

Rust 1.83 added support for `Option::expect` in `const` contexts:
https://blog.rust-lang.org/2024/11/28/Rust-1.83.0.html

This means we can now return an `Option` from
`extract_requirement_version` instead of panicing within it,
which makes it easier to test the function, and avoids the need
to explain that the panic inside the function was actually safe.
@edmorley edmorley added skip changelog Skip the check-changelog check internal Internal (non-user facing) buildpack changes labels Nov 28, 2024
@edmorley edmorley self-assigned this Nov 28, 2024
@edmorley edmorley marked this pull request as ready for review November 28, 2024 15:56
@edmorley edmorley requested a review from a team as a code owner November 28, 2024 15:56
@edmorley edmorley enabled auto-merge (squash) November 28, 2024 16:05
@edmorley edmorley merged commit e4b4114 into main Nov 29, 2024
9 checks passed
@edmorley edmorley deleted the const-option-unwrap branch November 29, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal (non-user facing) buildpack changes skip changelog Skip the check-changelog check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants