summaryrefslogtreecommitdiff
path: root/src/useflag
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-12-17 06:45:27 +0000
committerJohn Turner <jturner.usa@gmail.com>2025-12-17 06:45:27 +0000
commitc63c3e8c8c73ed7c036df7511ca190cdb96d92e2 (patch)
tree3262ef318f03388d37ac28493e42c1638c227c27 /src/useflag
parent0ec856797256b5d9807929e1b32c03756eb43124 (diff)
downloadgentoo-utils-split-into-workspace.tar.gz
Diffstat (limited to 'src/useflag')
-rw-r--r--src/useflag/meson.build1
-rw-r--r--src/useflag/mod.rs20
-rw-r--r--src/useflag/parsers.rs40
3 files changed, 0 insertions, 61 deletions
diff --git a/src/useflag/meson.build b/src/useflag/meson.build
deleted file mode 100644
index a7331a8..0000000
--- a/src/useflag/meson.build
+++ /dev/null
@@ -1 +0,0 @@
-sources += files('mod.rs', 'parsers.rs')
diff --git a/src/useflag/mod.rs b/src/useflag/mod.rs
deleted file mode 100644
index c367b1a..0000000
--- a/src/useflag/mod.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-use core::fmt;
-
-use get::Get;
-
-mod parsers;
-
-#[derive(Clone, Debug, PartialEq, Eq, Hash, Get)]
-pub struct UseFlag(#[get(method = "name", kind = "deref")] String);
-
-#[derive(Clone, Debug, PartialEq, Eq, Hash, Get)]
-pub struct IUseFlag {
- default: bool,
- flag: UseFlag,
-}
-
-impl fmt::Display for UseFlag {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(f, "{}", self.0)
- }
-}
diff --git a/src/useflag/parsers.rs b/src/useflag/parsers.rs
deleted file mode 100644
index ca5929d..0000000
--- a/src/useflag/parsers.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-use mon::{Parser, ParserIter, ascii_alphanumeric, one_of, tag};
-
-use crate::{
- Parseable,
- useflag::{IUseFlag, UseFlag},
-};
-
-impl<'a> Parseable<'a, &'a str> for UseFlag {
- type Parser = impl Parser<&'a str, Output = Self>;
-
- fn parser() -> Self::Parser {
- let start = ascii_alphanumeric();
- let rest = ascii_alphanumeric()
- .or(one_of("+_@-".chars()))
- .repeated()
- .many();
-
- start
- .and(rest)
- .recognize()
- .map(|output: &str| UseFlag(output.to_string()))
- }
-}
-
-impl<'a> Parseable<'a, &'a str> for IUseFlag {
- type Parser = impl Parser<&'a str, Output = Self>;
-
- fn parser() -> Self::Parser {
- UseFlag::parser()
- .preceded_by(tag("+"))
- .map(|flag| IUseFlag {
- default: true,
- flag,
- })
- .or(UseFlag::parser().map(|flag| IUseFlag {
- default: false,
- flag,
- }))
- }
-}