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 try_from_slice() and try_from_mut_slice() #117

Closed
wants to merge 2 commits into from

Conversation

peterkelly
Copy link

@peterkelly peterkelly commented May 7, 2021

Add two new methods for creating a GenericArray reference from a slice in situations where the caller doesn't know the length of the incoming slice. In such a situation, these methods are safer than from_slice() and from_mut_slice() because they don't panic.

@novacrazy novacrazy mentioned this pull request Mar 29, 2023
Merged
2 tasks
@fjarri
Copy link
Contributor

fjarri commented Aug 4, 2023

I think it would be even more convenient as a TryFrom<&[u8]> impl.

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