use Get proc macro on UseFlag struct

This commit is contained in:
John Turner
2025-10-27 21:59:15 -04:00
parent 847e5fc019
commit 183dc8edcd

View File

@@ -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)