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

Implement Extend/FromIterator for ArrayString #126

Closed
wants to merge 1 commit into from
Closed

Implement Extend/FromIterator for ArrayString #126

wants to merge 1 commit into from

Conversation

clarfonthey
Copy link
Contributor

Fixes #119. Caveat: takes the most conservative approach and doesn't extract any characters when there are less than 4 bytes left in the array.

@bluss
Copy link
Owner

bluss commented Jul 10, 2019

Hey, thanks for working on this. The pain point I've seen here before is exactly how do deal with capacity and error handling, since the two traits are not designed to do that. I think that this solution of leaving up to 3 unused capacity in a byte array, while understandable, is too confusing to use in arrayvec, and would in fact often go counter to the user's wish(?), say if they want to fit 10 ascii letters into 10-capacity array.

@clarfonthey
Copy link
Contributor Author

So to clarify, should I just close this PR then? Or would it be good to leave open as an option for the future?

@bluss
Copy link
Owner

bluss commented Sep 1, 2019

Yeah, let's close this for now. I think we haven't found good rules for how it should work.

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.

implement FromIterator<char> for ArrayString
2 participants