From 0448a529264d1a27d741bc817de468f8d359072d Mon Sep 17 00:00:00 2001 From: John Turner Date: Thu, 13 Nov 2025 19:49:22 +0000 Subject: impl Cp type --- src/atom/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/atom/mod.rs') diff --git a/src/atom/mod.rs b/src/atom/mod.rs index 0d1d3a9..6688665 100644 --- a/src/atom/mod.rs +++ b/src/atom/mod.rs @@ -108,6 +108,12 @@ pub struct UseDep { condition: Option, } +#[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) -- cgit v1.2.3