1use core::fmt;
4
5#[derive(Copy, Clone, Debug)]
7pub struct LoopError;
8
9impl fmt::Display for LoopError {
10    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
11        f.write_str("Loop Error")
12    }
13}
14
15#[cfg(feature = "std")]
16impl std::error::Error for LoopError {}
17
18#[derive(Copy, Clone, Debug)]
21pub struct InvalidLength;
22
23impl fmt::Display for InvalidLength {
24    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
25        f.write_str("Loop Error")
26    }
27}
28
29#[cfg(feature = "std")]
30impl std::error::Error for InvalidLength {}
31
32#[derive(Copy, Clone, Debug)]
35pub struct OverflowError;
36
37impl fmt::Display for OverflowError {
38    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
39        f.write_str("Overflow Error")
40    }
41}
42
43impl From<OverflowError> for LoopError {
44    fn from(_: OverflowError) -> LoopError {
45        LoopError
46    }
47}
48
49#[cfg(feature = "std")]
50impl std::error::Error for OverflowError {}