use std::fmt;
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Attempt(u32);
impl Attempt {
pub const FIRST: Self = Self(0);
#[must_use]
pub const fn new(attempt: u32) -> Self {
Self(attempt)
}
#[must_use]
pub const fn get(self) -> u32 {
self.0
}
#[must_use]
pub const fn next(self) -> Self {
Self(self.0.saturating_add(1))
}
}
impl fmt::Display for Attempt {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}