Skip to main content

bit_buf/
error.rs

1use core::fmt::{self, Display};
2
3/// Error from checked operations
4#[derive(Debug)]
5pub enum Error {
6  /// An operation failed due to storage not containing enough data
7  OutOfBounds,
8}
9
10impl Display for Error {
11  fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
12    use Error::*;
13    match self {
14      OutOfBounds => write!(f, "BitBuf: operation out of bounds"),
15    }
16  }
17}
18
19impl core::error::Error for Error {}