use std::str::Utf8Error;
pub(crate) trait Utf8ErrorOffsetBy {
fn offset_by(self, offset: usize) -> Self;
}
#[allow(dead_code)]
struct _Utf8Error {
valid_up_to: usize,
error_len: Option<u8>,
}
impl Utf8ErrorOffsetBy for Utf8Error {
#[inline]
fn offset_by(self, offset: usize) -> Self {
let mut this = unsafe { std::mem::transmute::<Self, _Utf8Error>(self) };
this.valid_up_to += offset;
unsafe { std::mem::transmute::<_Utf8Error, Self>(this) }
}
}