You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case that requires me to construct an ArrayString<CAP> from a UTF-8 ArrayVec<u8, CAP>. For Vec<u8> to String, I would use String::from_utf8, but the closest equivalent is ArrayString::from_byte_string, which won't work if the ArrayVec is not full. Therefore, I'd like to request a method such as:
This specific design entails adding a struct FromUtf8Error<const CAP: usize>, which would mimic std::string::FromUtf8Error; with that said, I'm not fussed about the specifics as long as I can (fallibly) get an ArrayString<CAP> from an ArrayVec<u8, CAP>.
Also, I have a workaround, so I'm not looking for solutions; it's just less elegant (and std-like) than I'd like.
The text was updated successfully, but these errors were encountered:
I have a use case that requires me to construct an
ArrayString<CAP>
from a UTF-8ArrayVec<u8, CAP>
. ForVec<u8>
toString
, I would useString::from_utf8
, but the closest equivalent isArrayString::from_byte_string
, which won't work if theArrayVec
is not full. Therefore, I'd like to request a method such as:This specific design entails adding a
struct FromUtf8Error<const CAP: usize>
, which would mimicstd::string::FromUtf8Error
; with that said, I'm not fussed about the specifics as long as I can (fallibly) get anArrayString<CAP>
from anArrayVec<u8, CAP>
.Also, I have a workaround, so I'm not looking for solutions; it's just less elegant (and
std
-like) than I'd like.The text was updated successfully, but these errors were encountered: