use super::*;
impl fmt::Display for RateLimitError {
#[inline(always)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::ZeroRate => f.write_str(ERR_ZERO_RATE),
Self::ZeroBurst => f.write_str(ERR_ZERO_BURST),
Self::ZeroPeriod => f.write_str(ERR_ZERO_PERIOD),
Self::InvalidLimit => f.write_str(ERR_INVALID_LIMIT),
Self::InvalidCapacity => f.write_str(ERR_INVALID_CAPACITY),
Self::ZeroCapacity => f.write_str(ERR_ZERO_CAPACITY),
Self::Overflow => f.write_str(ERR_OVERFLOW),
}
}
}
impl Error for RateLimitError {}