-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow comments in
{% match %}
and remove panic!
- Loading branch information
Showing
4 changed files
with
55 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use askama::Template; | ||
|
||
#[derive(Template)] | ||
#[template( | ||
ext = "txt", | ||
source = r#" | ||
{%- match good -%} | ||
// Help, I forgot how to write comments! | ||
{%- when true %} | ||
good | ||
{%- when _ -%} | ||
bad | ||
{%- endmatch -%}"# | ||
)] | ||
struct MatchWithExtra { | ||
good: bool, | ||
} | ||
|
||
fn main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: problems parsing template source at row 3, column 4 near: | ||
"// Help, I forgot how to write comments!"... | ||
--> tests/ui/match_with_extra.rs:3:10 | ||
| | ||
3 | #[derive(Template)] | ||
| ^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) |