use arcstr::ArcStr;
use crate::{ArcStrUtf8Encoder, Utf8Encoder};
impl<T: AsRef<[u8]>> ArcStrUtf8Encoder for T {
fn to_utf8_arcstr(&self) -> ArcStr {
let bytes = self.as_ref();
std::str::from_utf8(bytes)
.map_or_else(|_| ArcStr::from(bytes.to_utf8_string()), ArcStr::from)
}
}