Module ructe::Template_syntax::c_Conditionals
[−]
[src]
Both @if
statements with boolean expressions and match-like
guard @if let
statements are supported.
Conditionals
Rust-like conditionals are supported in a style similar to the loops:
@if items.is_empty() {
<p>There are no items.</p>
}
Pattern matching let expressions are also supported, as well as an optional else part.
@if let Some(foo) = foo {
<p>Foo is @foo.</p>
} else {
<p>There is no foo.</p>
}
General rust match
statements are not supported in ructe
(at least not yet).