forked from gentoo-utils/gentoo-utils
impl Cp type
This commit is contained in:
@@ -108,6 +108,12 @@ pub struct UseDep {
|
||||
condition: Option<UseDepCondition>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Get)]
|
||||
pub struct Cp {
|
||||
category: Category,
|
||||
name: Name,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Get)]
|
||||
pub struct Cpv {
|
||||
category: Category,
|
||||
@@ -558,6 +564,12 @@ impl fmt::Display for UseDep {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Cp {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}/{}", &self.category, &self.name)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Cpv {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}/{}-{}", &self.category, &self.name, &self.version)
|
||||
|
||||
Reference in New Issue
Block a user