#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum DeliberationOutcome {
Success,
NoValidProposal,
}
impl DeliberationOutcome {
#[must_use]
pub const fn as_label(self) -> &'static str {
match self {
Self::Success => "success",
Self::NoValidProposal => "no_valid_proposal",
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn labels_are_stable_and_distinct() {
assert_eq!(DeliberationOutcome::Success.as_label(), "success");
assert_eq!(
DeliberationOutcome::NoValidProposal.as_label(),
"no_valid_proposal"
);
assert_ne!(
DeliberationOutcome::Success.as_label(),
DeliberationOutcome::NoValidProposal.as_label()
);
}
}