oct/error/
non_zero_decode_error.rs1use core::convert::Infallible;
10use core::error::Error;
11use core::fmt::{self, Display, Formatter};
12
13#[derive(Debug, Eq, PartialEq)]
17pub struct NonZeroDecodeError;
18
19impl Display for NonZeroDecodeError {
20 #[inline]
21 fn fmt(&self, f: &mut Formatter) -> fmt::Result {
22 write!(f, "expected non-zero integer but found `0`")
23 }
24}
25
26impl Error for NonZeroDecodeError { }
27
28impl From<Infallible> for NonZeroDecodeError {
29 #[inline(always)]
30 fn from(_value: Infallible) -> Self {
31 unreachable!()
32 }
33}