diff --git a/src/useflag/mod.rs b/src/useflag/mod.rs index 21a746a..16104d6 100644 --- a/src/useflag/mod.rs +++ b/src/useflag/mod.rs @@ -4,8 +4,8 @@ use get::Get; pub mod parsers; -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct UseFlag(String); +#[derive(Clone, Debug, PartialEq, Eq, Get)] +pub struct UseFlag(#[get(method = "name")] String); #[derive(Clone, Debug, PartialEq, Eq, Get)] pub struct IUseFlag { @@ -13,12 +13,6 @@ pub struct IUseFlag { flag: UseFlag, } -impl UseFlag { - pub fn get(&self) -> &str { - self.0.as_str() - } -} - impl fmt::Display for UseFlag { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.0)