Make length type generic
It's really a lot of work being done
This PR resolves #247, supersedes #248
However, some things are broken:
type inference won't work for ArrayVec::from([0; N]) like before
some functions like len() are no longer const, unless nightly is enabled
This PR is expected to be merged after #255
I'm really interested in this, but it seems like there are conflicts that need to be resolved @JakkuSakura?
Hi, while it's easy to resolve the conflicts, the potentially breaking semantics should be carefully evaluated by the author, before merging
Okay, I've opened a PR on your repo with some fun type system hacks that fix the inference for From<[T; CAP]> in a lot of cases, and also makes the default use the proper type instead of u32 in a lot of cases. If/When trait associated type defaults are a thing, this will become basically perfect, but as-is it needs users to provide LenT if the CAP value isn't in the predefined list of CAP => LenT.
It's almost perfect
let string = ArrayString::<11>::from_byte_string(b"hello world").unwrap();
the only tests that failed was ArrayString without <11>. it's related to the way rust handles inferred type with default type generics.
Hi folks, I'm also really interested in this feature. Is there anything I could help with to move this forward?