diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-29 03:31:44 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-29 03:31:44 +0800 |
| commit | ff70307869a547b13850d1eec3f72e8ca3bca265 (patch) | |
| tree | a6cc55e7cb993697dce95b3d449538ec296693fc /src/template.rs | |
| parent | 03003aec99fc00c2a079bad9fb4e721432a6e6f0 (diff) | |
feat: add display block support and refactor tests
Deprecate old macros in favor of new deprecated module, replace the
external file-based test with inline unit tests, and introduce the
`??? >>>` / `??? <<<` display block syntax for conditional content
inclusion per arm or globally.
Diffstat (limited to 'src/template.rs')
| -rw-r--r-- | src/template.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/template.rs b/src/template.rs index 27e14df..e368917 100644 --- a/src/template.rs +++ b/src/template.rs @@ -15,9 +15,7 @@ impl Template { /// Add an implementation block and return a HashMap to set its parameters pub fn add_impl(&mut self, impl_name: String) -> &mut Vec<HashMap<String, String>> { - self.impl_params - .entry(impl_name) - .or_insert_with(|| Vec::<HashMap<String, String>>::new()) + self.impl_params.entry(impl_name).or_default() } } |
