32 lines
589 B
Rust
32 lines
589 B
Rust
use sailfish::RenderOnce;
|
|
use sailfish_macros::RenderOnce;
|
|
|
|
struct Content<'a> {
|
|
id: u32,
|
|
address: &'a str,
|
|
phone_number: &'a str,
|
|
}
|
|
|
|
#[derive(RenderOnce)]
|
|
#[template(path = "unexpected_token.stpl")]
|
|
struct UnexpectedToken<'a> {
|
|
name: &'a str,
|
|
content: Content<'a>,
|
|
}
|
|
|
|
fn main() {
|
|
println!(
|
|
"{}",
|
|
UnclosedToken {
|
|
name: "Taro",
|
|
content: Content {
|
|
id: 1,
|
|
address: "oooo-xxxx",
|
|
phone_number: "000-000-0000"
|
|
}
|
|
}
|
|
.render_once()
|
|
.unwrap()
|
|
)
|
|
}
|