Skip to content

Remove unnecessary unsafe in favour of const fns#23

Merged
LPGhatguy merged 2 commits intoLPGhatguy:mainfrom
michaelsproul:remove-unsafe
Oct 22, 2025
Merged

Remove unnecessary unsafe in favour of const fns#23
LPGhatguy merged 2 commits intoLPGhatguy:mainfrom
michaelsproul:remove-unsafe

Conversation

@michaelsproul
Copy link
Copy Markdown
Contributor

@michaelsproul michaelsproul commented Oct 22, 2025

Now that Option::unwrap is const (as of Rust 1.83.0), we can avoid using unsafe in the initialisation of constants.

Similarly, Default can just refer to Self::ZERO without a (new) use of unsafe.

Copy link
Copy Markdown
Owner

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

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

Sick, easy change!

@LPGhatguy
Copy link
Copy Markdown
Owner

Ah! Less easy, we'll also need to bump our MSRV to 1.83.0. Given that 1.83.0 is around a year old and there hasn't been a nonmax release in awhile anyways, I think I'm good to bump the MSRV (and then probably release 1.0 sooner than later!)

@LPGhatguy LPGhatguy merged commit add5619 into LPGhatguy:main Oct 22, 2025
5 checks passed
@michaelsproul
Copy link
Copy Markdown
Contributor Author

Awesome, thanks!

@michaelsproul michaelsproul deleted the remove-unsafe branch October 22, 2025 21:42
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