use petgraph::graph::NodeIndex;
pub type CandidateId = NodeIndex;
#[derive(Copy, Clone)]
pub struct CandidateRef {
weight: Option<u32>,
}
impl CandidateRef {
pub(crate) fn butt() -> Self {
Self { weight: None }
}
pub fn new(weight: u32) -> Self {
Self {
weight: Some(weight),
}
}
pub(crate) fn is_butt(&self) -> bool {
self.weight.is_none()
}
pub fn weight(&self) -> u32 {
self.weight.unwrap_or_default()
}
}