From 4a733993c8efd95f51b57786035536ae672f5bfb Mon Sep 17 00:00:00 2001 From: Chris Wong <lambda.fairy@gmail.com> Date: Sun, 30 Jul 2017 21:17:12 +1200 Subject: [PATCH] Make let expression type ascription test a bit more elaborate An overly strict parser would choke on the `=` in `Iterator<Item=u32>`, so this case is worth keeping as a regression test. --- maud/tests/control_structures.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maud/tests/control_structures.rs b/maud/tests/control_structures.rs index 4cb774d..28faf04 100644 --- a/maud/tests/control_structures.rs +++ b/maud/tests/control_structures.rs @@ -160,8 +160,8 @@ fn let_lexical_scope() { #[test] fn let_type_ascription() { let s = html! { - @let x: u32 = 42 { - "I have " (x) " cupcakes!" + @let mut x: Box<Iterator<Item=u32>> = Box::new(vec![42].into_iter()) { + "I have " (x.next().unwrap()) " cupcakes!" } }.into_string(); assert_eq!(s, "I have 42 cupcakes!");