diff options
author | mcarton <cartonmartin+git@gmail.com> | 2018-12-12 20:43:36 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-12-12 21:48:41 +0100 |
commit | 48c5ebbd2be8f7d89f37f3aa04500b8ad1a3d460 (patch) | |
tree | b21964dcbce68948ae3dee763ea7c61931ed5167 /testing/tests/matches.rs | |
parent | 9e1cf8f0dff3bd96db4b25703877db5632267ed2 (diff) | |
download | askama-48c5ebbd2be8f7d89f37f3aa04500b8ad1a3d460.tar.gz askama-48c5ebbd2be8f7d89f37f3aa04500b8ad1a3d460.tar.bz2 askama-48c5ebbd2be8f7d89f37f3aa04500b8ad1a3d460.zip |
Allow using brackets for enums in `match`
Diffstat (limited to 'testing/tests/matches.rs')
-rw-r--r-- | testing/tests/matches.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/testing/tests/matches.rs b/testing/tests/matches.rs index 89082ef..8657fa5 100644 --- a/testing/tests/matches.rs +++ b/testing/tests/matches.rs @@ -62,7 +62,7 @@ fn test_match_literal_num() { #[allow(dead_code)] enum Color { - Rgb(u32, u32, u32), + Rgb { r: u32, g: u32, b: u32 }, GrayScale(u32), Cmyk(u32, u32, u32, u32), } @@ -76,7 +76,11 @@ struct MatchCustomEnumTemplate { #[test] fn test_match_custom_enum() { let s = MatchCustomEnumTemplate { - color: Color::Rgb(160, 0, 255), + color: Color::Rgb { + r: 160, + g: 0, + b: 255, + }, }; assert_eq!(s.render().unwrap(), "\n\nColorful: #A000FF\n"); } |