diff options
author | René Kijewski <kijewski@library.vetmed.fu-berlin.de> | 2022-01-31 11:34:48 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2022-01-31 13:12:09 +0100 |
commit | 84fe3814033d1ec8669f253964cfa1145b4f53e9 (patch) | |
tree | 015f10bd3acf155f85e9335697dfcea01234942d /askama_shared/src/generator.rs | |
parent | 0e9c9aeb9ddf8b86eeb86e1822f7285f65bc0b9d (diff) | |
download | askama-84fe3814033d1ec8669f253964cfa1145b4f53e9.tar.gz askama-84fe3814033d1ec8669f253964cfa1145b4f53e9.tar.bz2 askama-84fe3814033d1ec8669f253964cfa1145b4f53e9.zip |
Remove `panic!()` in `loop.cycle([])`
Diffstat (limited to 'askama_shared/src/generator.rs')
-rw-r--r-- | askama_shared/src/generator.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index acd716b..daf22ae 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -1328,7 +1328,7 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { "cycle" => match args { [arg] => { if matches!(arg, Expr::Array(arr) if arr.is_empty()) { - panic!("loop.cycle(…) cannot use an empty array."); + return Err("loop.cycle(…) cannot use an empty array".into()); } buf.write("({"); buf.write("let _cycle = &("); |