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

Replace arrayref with TryInto #80

Merged
merged 1 commit into from
Feb 13, 2020
Merged

Replace arrayref with TryInto #80

merged 1 commit into from
Feb 13, 2020

Conversation

BlackHoleFox
Copy link
Contributor

Title pretty much says it all. We were only using on one line, to get the first 32 bytes of a key for Diffe-Hellman 25519. Since Rust 1.34, TryInto works for turning slices into arrays, as noted here. 32 bytes is the limit until const generics, but conveniently 32 is all we need for this.

Overall, seems a tad overkill to bring in an entire library for one line that Rust core functionality offers.

@mcginty
Copy link
Owner

mcginty commented Feb 13, 2020

Oh nice - I didn't know TryInto implemented this! Fantastic, one less unsafe dependency.

@mcginty mcginty merged commit 133323f into mcginty:master Feb 13, 2020
@BlackHoleFox BlackHoleFox deleted the remove-arrayref branch February 13, 2020 03:28
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