use core::fmt::{self, Display};
#[derive(Debug, PartialEq)]
pub enum Error {
Unaligned,
OutOfBounds,
InvalidBitCount,
}
impl Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use Error::*;
match self {
OutOfBounds => write!(f, "BitBuf: operation out of bounds"),
Unaligned => write!(f, "BitBuf: aligned operation on unaligned cursor"),
InvalidBitCount => write!(f, "BitBuf: requested bit count exceeds type width"),
}
}
}
impl core::error::Error for Error {}