summaryrefslogtreecommitdiffstats
path: root/vendor/digest-0.8.1/src/errors.rs
blob: aa026a21a1d09f1520e93969a565154e8f26ef0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use core::fmt;
#[cfg(feature = "std")]
use std::error;

/// The error type for variable hasher initialization
#[derive(Clone, Copy, Debug, Default)]
pub struct InvalidOutputSize;

impl fmt::Display for InvalidOutputSize {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("invalid output size")
    }
}

#[cfg(feature = "std")]
impl error::Error for InvalidOutputSize {
    fn description(&self) -> &str {
        "invalid output size"
    }
}