forked from gentoo-utils/gentoo-utils
use Get proc macro on UseFlag struct
This commit is contained in:
@@ -4,8 +4,8 @@ use get::Get;
|
|||||||
|
|
||||||
pub mod parsers;
|
pub mod parsers;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq, Get)]
|
||||||
pub struct UseFlag(String);
|
pub struct UseFlag(#[get(method = "name")] String);
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Get)]
|
#[derive(Clone, Debug, PartialEq, Eq, Get)]
|
||||||
pub struct IUseFlag {
|
pub struct IUseFlag {
|
||||||
@@ -13,12 +13,6 @@ pub struct IUseFlag {
|
|||||||
flag: UseFlag,
|
flag: UseFlag,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UseFlag {
|
|
||||||
pub fn get(&self) -> &str {
|
|
||||||
self.0.as_str()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Display for UseFlag {
|
impl fmt::Display for UseFlag {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "{}", self.0)
|
write!(f, "{}", self.0)
|
||||||
|
|||||||
Reference in New Issue
Block a user