From 268d8250fb0a9cdcbbd760bdf39424ed02fd1920 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Sat, 17 Jul 2021 13:40:49 +0200 Subject: Use "target()" to parse "when" block `target()` as used in parsing "let" and "if let" implements parsing nested tuples and structs. But it does not implement parsing literals. The functions `match_variant()` and `with_parameters()` as used in parsing "when" blocks do not implement parsing nested structs, but it implements parsing literals. This PR combines `match_variant()` and `with_parameters()` into `target()`, so that all `{%when%}` support nested structs, too. --- testing/templates/match-option-result-option.html | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 testing/templates/match-option-result-option.html (limited to 'testing/templates') diff --git a/testing/templates/match-option-result-option.html b/testing/templates/match-option-result-option.html new file mode 100644 index 0000000..25396b6 --- /dev/null +++ b/testing/templates/match-option-result-option.html @@ -0,0 +1,10 @@ +{%- match foo -%} + {%- when None -%} + nothing + {%- when Some(Err(err)) -%} + err={{err}} + {%- when Some(Ok(None)) -%} + num=absent + {%- when Some(Ok(Some(num))) -%} + num={{num}} +{%- endmatch -%} -- cgit