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 FromIterator<char> for ArrayString #119

Open
elichai opened this issue Feb 14, 2019 · 4 comments
Open

implement FromIterator<char> for ArrayString #119

elichai opened this issue Feb 14, 2019 · 4 comments

Comments

@elichai
Copy link
Contributor

elichai commented Feb 14, 2019

Hi,
I want to use ArrayString in rustc_hex::ToHex, this trait works on every type that implements FromIterator on Item=char.
But ArrayString is Item=u8.

Is there a reason this isn't Item=char?

@clarfonthey
Copy link
Contributor

ArrayString doesn't implement FromIterator at all. Presumably a PR adding this would be accepted.

@elichai
Copy link
Contributor Author

elichai commented Jun 24, 2019

So it's not that easy because ArrayString and ArrayVec are inherently different.
How do you think about making ArrayString just a wrapper of ArrayVec with the generic Array set to Array<Item=u8>? (just like String is a wrapper for Vec)

If so maybe i'll work on a PR

@bluss
Copy link
Owner

bluss commented Sep 25, 2019

@elichai That won't work so well, ArrayString should be a wrapper around "ArrayVecCopy" (not yet implemented).

@bluss bluss added the question label Mar 23, 2021
@bluss bluss changed the title Should ArrayString be Item=char? implement FromIterator<char> for ArrayString Mar 23, 2021
@chris-morgan
Copy link

Closely related is core::iter::Extend<A>, which String implements for A = char | Box<str> | String | &char | &str | Cow<str>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants