summaryrefslogtreecommitdiff
path: root/src/template.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-02-28 14:06:54 +0800
committer魏曹先生 <1992414357@qq.com>2026-02-28 14:06:54 +0800
commit936033f39e391b44562bb8702e9c30bcf6905e85 (patch)
tree97a9bcaea404372b1b309661115583e115a9c0aa /src/template.rs
parent55b31ee792963b4c23eae95f2216891b00cd6a69 (diff)
Refactor crate structure and move macros to lib.rs
Diffstat (limited to 'src/template.rs')
-rw-r--r--src/template.rs33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/template.rs b/src/template.rs
index 2df8e46..622f191 100644
--- a/src/template.rs
+++ b/src/template.rs
@@ -1,8 +1,5 @@
use std::collections::HashMap;
-pub mod expand;
-pub mod test;
-
#[derive(Default, Clone)]
pub struct Template {
pub(crate) template_str: String,
@@ -39,33 +36,3 @@ impl std::fmt::Display for Template {
write!(f, "{}", cloned.expand().unwrap_or_default())
}
}
-
-#[macro_export]
-macro_rules! tmpl_param {
- ($template:ident, $($key:ident = $value:expr),* $(,)?) => {{
- $(
- $template.insert_param(stringify!($key).to_string(), $value.to_string());
- )*
- }};
-}
-
-#[macro_export]
-macro_rules! tmpl {
- ($template:ident += {
- $($name:ident {
- $(($($key:ident = $value:expr),* $(,)?)),*
- $(,)?
- }),*
- }) => {{
- $(
- let $name = $template.add_impl(stringify!($name).to_string());
- $(
- $name.push({
- let mut params = std::collections::HashMap::new();
- $(params.insert(stringify!($key).to_string(), $value.to_string());)*
- params
- });
- )*
- )*
- }};
-}