const_frac/
error.rs

1use core::fmt:: { self, Debug, Display };
2use combine::error::StringStreamError;
3
4#[cfg(feature = "std")]
5use std;
6
7/// Error for this package.
8/// Maybe change.
9#[non_exhaustive]
10#[derive(Clone, Copy, Debug)]
11pub enum Error {
12    NotF64,
13    NotI32,
14    ZeroDivide,
15    Overflow,
16    ParseError(StringStreamError),
17}
18
19impl Display for Error {
20    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
21        Debug::fmt(self, f)
22    }
23}
24
25#[cfg(feature = "std")]
26impl std::error::Error for Error {}