use std::fmt::Display;
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum Phase {
#[default]
SystemDiscovery,
Ignores,
ScriptDependencies,
Main,
}
impl Phase {
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::SystemDiscovery => "phase_system_discovery",
Self::Ignores => "phase_ignores",
Self::ScriptDependencies => "phase_script_dependencies",
Self::Main => "phase_main",
}
}
}
impl Display for Phase {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.as_str())
}
}