Why not a `ArrayStr<N>` for `str` as array for slice in std?

There are several implementations of this in 3rd party crates. heapless::String, for example.

Bringing it into core/std has many repercussions, including: does it really make sense to use a specialized data structure instead of String? What if you could use a byte array as the backing storage for a String instead, since String is generic around an Allocator?

This is where things like a proposed storages API come into play: Pre-RFC: Storage API

It would sure be nice for whatever solution emerges to work with core and be able to replace things like heapless::String.

1 Like