Skip to content

implement FromIterator<char> for ArrayString #119

Open

Description

@elichai

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?

Activity

  1. clarfonthey commented on Jun 22, 2019

    @clarfonthey
    Contributor

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

  2. elichai commented on Jun 24, 2019

    @elichai
    ContributorAuthor

    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

  3. bluss commented on Sep 25, 2019

    @bluss
    Owner

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

  4. changed the title [-]Should ArrayString be Item=char?[/-] [+]implement FromIterator<char> for ArrayString[/+] on Mar 23, 2021
  5. chris-morgan commented on Jan 5, 2022

    @chris-morgan

    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions