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

Add const to new_unchecked() #28

Merged
merged 1 commit into from
Aug 26, 2023
Merged

Add const to new_unchecked() #28

merged 1 commit into from
Aug 26, 2023

Conversation

CuriouslyCurious
Copy link
Contributor

@CuriouslyCurious CuriouslyCurious commented Aug 2, 2023

I have a need to have a FlagSet in a compile-time constant, which wasn't possible before, so I simply added const to new_unchecked.

I didn't add const to the other new_* functions due to the Flag::Type calling default() which is not yet possible in a const context.

While it is unfortunate that you have to have an unsafe block to have a FlagSet in a constant, it is however better than it not being possible at all. :P

@CuriouslyCurious CuriouslyCurious requested a review from a team as a code owner August 2, 2023 23:07
@CuriouslyCurious CuriouslyCurious requested review from haraldh and removed request for a team August 2, 2023 23:07
@rjzak rjzak enabled auto-merge (rebase) August 3, 2023 16:05
@rjzak
Copy link
Member

rjzak commented Aug 20, 2023

@npmccallum or @rvolosatovs Can the minimal version of Rust be incremented to a point where this can be used?

@rjzak
Copy link
Member

rjzak commented Aug 25, 2023

@CuriouslyCurious Looks good to me, but could you re-write the commit message so it's a conventional commit? It'll allow the last test to pass. Something like feat: add const to new_unchecked()

Signed-off-by: CuriouslyCurious <[email protected]>
auto-merge was automatically disabled August 25, 2023 22:29

Head branch was pushed to by a user without write access

@CuriouslyCurious
Copy link
Contributor Author

@CuriouslyCurious Looks good to me, but could you re-write the commit message so it's a conventional commit? It'll allow the last test to pass. Something like feat: add const to new_unchecked()

Fixed it. ^^

@rjzak rjzak enabled auto-merge (rebase) August 26, 2023 00:00
@rjzak rjzak merged commit 3acd8b6 into enarx:main Aug 26, 2023
11 of 12 checks passed
@rjzak
Copy link
Member

rjzak commented Aug 26, 2023

Thank you for your contribution!

@CuriouslyCurious CuriouslyCurious deleted the const branch August 26, 2023 09:09
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.

2 participants