arrayvec
arrayvec copied to clipboard
implement FromIterator<char> for ArrayString
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?
ArrayString
doesn't implement FromIterator
at all. Presumably a PR adding this would be accepted.
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
@elichai That won't work so well, ArrayString should be a wrapper around "ArrayVecCopy" (not yet implemented).
Closely related is core::iter::Extend<A>
, which String
implements for A = char | Box<str> | String | &char | &str | Cow<str>
.