impl FromIterator<char> for ArrayString#142
Conversation
String includes a number of other impls for e.g. &char and &str, and we could expand the impls here in a follow-up commit if we want.
|
This enables you to |
|
This is a duplicate of #126, which was ultimately not merged. |
|
Oh thanks for the link. One thing this highlights for me is that I misunderstood how My main reason for preferring to panic was that it fit my use case :) Namely, I know exactly how long a certain string is going to be, and I've allocated exactly enough space to contain it. If it turned out I didn't have enough space, that would be a bug in my code, and I would want to see a panic telling me to fix it. Do you find the "ignore the rest of the iterator" use case common? If so, then I don't have any better ideas than what you discussed in #126, and I agree that not implementing this at all might be better than implementing something surprising. But is there any chance a future version of ArrayVec might prefer to switch to panicking behavior for |
|
I don't think there's going to be a good sense of what's best until we have a clearer idea of what falliable |
String includes a number of other impls for e.g. &char and &str, and we
could expand the impls here in a follow-up commit if we want.