Return a proper error for `into_inner`
This PR adds a new error type representing an under-filled state for ArrayVec::into_inner. Previously, it would return self which is rather unconventional and prevents ergonomic error propagation (e.g. with ?).
This change is a breaking change and would need a new major version.
After the change, one could no longer recover the original array.
Workaround for your use case: You can use .map_err(|_| YourError::Underfilled)? to use it with the question mark operator.
Thanks for the feedback, I changed it so that the error stores the original vec, allowing the user to recover it using take_vec.
Workaround for your use case: You can use
.map_err(|_| YourError::Underfilled)?to use it with the question mark operator.
This is what I'm currently doing, but it'd more convenient to have a canonical error type :slightly_smiling_face: