use core::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum CopyError {
DataLength {
expected: usize,
found: usize,
},
InvalidStride {
stride: usize,
width: usize,
},
}
impl fmt::Display for CopyError {
#[expect(clippy::missing_inline_in_public_items)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::DataLength { expected, found } => write!(
f,
"data length mismatch, expected {expected}, found {found}"
),
Self::InvalidStride { stride, width } => write!(
f,
"provided stride {stride} was less than the visible width {width}"
),
}
}
}
impl core::error::Error for CopyError {}