use std::fmt;
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub enum DependencyKind {
Normal,
Development,
Build,
}
impl DependencyKind {
pub const VALUES: &'static [Self; 3] = &[
DependencyKind::Normal,
DependencyKind::Development,
DependencyKind::Build,
];
pub fn to_str(self) -> &'static str {
match self {
DependencyKind::Normal => "normal",
DependencyKind::Development => "dev",
DependencyKind::Build => "build",
}
}
}
impl fmt::Display for DependencyKind {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.to_str())
}
}