diff options
author | HampusM <hampus@hampusmat.com> | 2023-02-25 14:34:32 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-02-25 14:34:32 +0100 |
commit | 5a00534bd4c0a44d063c592a471b8b546f1b5925 (patch) | |
tree | 2ed65e7b086e2ecafe1c557c87390bd25b1ab523 | |
parent | 0f7696236b6b4d1011cefc860da332ffe11b1b1f (diff) |
refactor: remove ParagraphPart 'inner' method
-rw-r--r-- | src/description.rs | 5 | ||||
-rw-r--r-- | src/lib.rs | 1 | ||||
-rw-r--r-- | src/util.rs | 34 |
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 { @@ -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; |