freemarker 0.1.1

Apache FreeMarker 语义兼容的 Rust 模板引擎(freemarker-core 迁移)
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! 简单布尔 —— 对应 Java `freemarker.template.TrueTemplateBooleanModel` / `FalseTemplateBooleanModel`

use crate::error::Result;
use crate::template::TemplateBooleanModel;

pub struct SimpleBoolean(pub bool);
impl TemplateBooleanModel for SimpleBoolean {
    fn as_boolean(&self) -> Result<bool> {
        Ok(self.0)
    }
}