Skip to main content

osom_lib_primitives/power_of_two/
errors.rs

1use osom_lib_reprc::macros::reprc;
2
3/// Represents possible errors when interacting with [`PowerOfTwo32`][`super::PowerOfTwo32`]
4/// and [`PowerOfTwo64`][`super::PowerOfTwo64`].
5#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
6#[reprc]
7#[repr(u8)]
8#[must_use]
9pub enum PowerOfTwoError {
10    NotAPowerOfTwo = 0,
11}
12
13impl core::fmt::Display for PowerOfTwoError {
14    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15        match self {
16            PowerOfTwoError::NotAPowerOfTwo => write!(f, "PowerOfTwoError::NotAPowerOfTwo"),
17        }
18    }
19}