summaryrefslogtreecommitdiff
path: root/src/atom/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/atom/mod.rs')
-rw-r--r--src/atom/mod.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/atom/mod.rs b/src/atom/mod.rs
index 1f9c351..11c56f8 100644
--- a/src/atom/mod.rs
+++ b/src/atom/mod.rs
@@ -28,13 +28,13 @@ pub enum VersionOperator {
}
#[derive(Clone, Debug, PartialEq, Eq, Get)]
-pub struct Category(#[get(method = "get")] String);
+pub struct Category(#[get(method = "get", kind = "deref")] String);
#[derive(Clone, Debug, PartialEq, Eq, Get)]
-pub struct Name(#[get(method = "get")] String);
+pub struct Name(#[get(method = "get", kind = "deref")] String);
#[derive(Clone, Debug, Get)]
-pub struct VersionNumber(#[get(method = "get")] String);
+pub struct VersionNumber(#[get(method = "get", kind = "deref")] String);
#[derive(Clone, Copy, Debug)]
pub enum VersionSuffixKind {
@@ -53,8 +53,10 @@ pub struct VersionSuffix {
#[derive(Clone, Debug, Get)]
pub struct Version {
+ #[get(kind = "deref")]
numbers: Vec<VersionNumber>,
letter: Option<char>,
+ #[get(kind = "deref")]
suffixes: Vec<VersionSuffix>,
rev: Option<VersionNumber>,
}
@@ -66,7 +68,7 @@ pub enum SlotOperator {
}
#[derive(Clone, Debug, PartialEq, Eq, Get)]
-pub struct SlotName(#[get(method = "name")] String);
+pub struct SlotName(#[get(method = "name", kind = "deref")] String);
#[derive(Clone, Debug, PartialEq, Eq, Get)]
pub struct Slot {
@@ -109,6 +111,7 @@ pub struct Atom {
name: Name,
version: Option<Version>,
slot: Option<Slot>,
+ #[get(kind = "deref")]
usedeps: Vec<UseDep>,
}
@@ -181,7 +184,7 @@ impl fmt::Display for Version {
let numbers = self
.numbers
.iter()
- .map(|n| n.get().as_str())
+ .map(|n| n.get())
.intersperse(".")
.collect::<String>();