askama/testing/tests/ui/match-unit-structs.rs
2025-03-11 19:31:06 +01:00

25 lines
319 B
Rust

use askama::Template;
enum Greeting {
Hello,
Hey,
Hi,
}
#[derive(Template)]
#[template(
ext = "txt",
source = r#"
{%- match greeting -%}
{%- when Hello -%} Hello!
{%- when Hey -%} Hey!
{%- when Hi -%} Hi!
{%- endmatch -%}"#
)]
struct Greeter {
greeting: Greeting,
}
fn main() {
}