summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-02-25 14:34:32 +0100
committerHampusM <hampus@hampusmat.com>2023-02-25 14:34:32 +0100
commit5a00534bd4c0a44d063c592a471b8b546f1b5925 (patch)
tree2ed65e7b086e2ecafe1c557c87390bd25b1ab523 /src
parent0f7696236b6b4d1011cefc860da332ffe11b1b1f (diff)
refactor: remove ParagraphPart 'inner' method
Diffstat (limited to 'src')
-rw-r--r--src/description.rs5
-rw-r--r--src/lib.rs1
-rw-r--r--src/util.rs34
3 files changed, 0 insertions, 40 deletions
diff --git a/src/description.rs b/src/description.rs
index d57dbc7..adc5324 100644
--- a/src/description.rs
+++ b/src/description.rs
@@ -1,5 +1,4 @@
//! Reference entry description.
-use crate::util::enum_with_get_inner;
use crate::xml::element::{Elements, FromElements, Tagged};
/// Reference entry description.
@@ -106,9 +105,6 @@ pub enum ParagraphError
InvalidPart(#[from] ParagraphPartError),
}
-enum_with_get_inner! {
-inner = String;
-
/// Reference entry description paragraph part.
#[derive(Debug)]
pub enum ParagraphPart
@@ -128,7 +124,6 @@ pub enum ParagraphPart
/// Reference entry citation part.
Entry(String),
}
-}
impl FromElements for ParagraphPart
{
diff --git a/src/lib.rs b/src/lib.rs
index f4d465f..11d376c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -15,7 +15,6 @@ use crate::xml::parser::{Error as ParserError, Parser};
pub mod description;
-mod util;
mod xml;
static GL4_DIR: Dir = include_dir!("$CARGO_MANIFEST_DIR/OpenGL-Refpages/gl4");
diff --git a/src/util.rs b/src/util.rs
deleted file mode 100644
index 309a471..0000000
--- a/src/util.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-macro_rules! enum_with_get_inner {
- (
- inner = $inner: ty;
- $(#[$attr: meta])*
- $visibility: vis enum $enum_name: ident {
- $(
- $(#[$variant_attr: meta])*
- $variant: ident($variant_inner: ty),
- )*
- }
- ) => {
- $(#[$attr])*
- $visibility enum $enum_name {
- $(
- $(#[$variant_attr])*
- $variant($inner)
- ),*
- }
-
- impl $enum_name {
- /// Returns the inner value.
- #[must_use]
- pub fn inner(&self) -> &$inner {
- match self {
- $(
- $enum_name::$variant(inner) => inner
- ),*
- }
- }
- }
- };
-}
-
-pub(crate) use enum_with_get_inner;