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;
|
||||
|
||||
#[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)
|
||||
|
||||
Reference in New Issue
Block a user