sailfish/sailfish-tests/integration-tests/tests/fails/unexpected_token.rs

32 lines
589 B
Rust
Raw Normal View History

2024-03-11 17:33:11 -04:00
use sailfish::RenderOnce;
use sailfish_macros::RenderOnce;
2020-06-11 02:33:13 -04:00
struct Content<'a> {
id: u32,
address: &'a str,
phone_number: &'a str,
}
2024-03-11 17:33:11 -04:00
#[derive(RenderOnce)]
2020-06-11 02:33:13 -04:00
#[template(path = "unexpected_token.stpl")]
struct UnexpectedToken<'a> {
name: &'a str,
2024-03-11 17:33:11 -04:00
content: Content<'a>,
2020-06-11 02:33:13 -04:00
}
fn main() {
println!(
"{}",
UnclosedToken {
name: "Taro",
content: Content {
id: 1,
address: "oooo-xxxx",
phone_number: "000-000-0000"
}
}
.render_once()
.unwrap()
)
}