From 444d3ea5bdd42daf0932ef388c6310327438b4a9 Mon Sep 17 00:00:00 2001 From: freund17 Date: Wed, 7 Aug 2019 12:20:31 +0200 Subject: [PATCH] ch19-06 added curly braces to macro output I'm just learning rust (reading this book) so I might be wrong here... But shouldn't the generated macro-output include the extra curly braces? --- src/ch19-06-macros.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ch19-06-macros.md b/src/ch19-06-macros.md index fbb2246934..0d805a4721 100644 --- a/src/ch19-06-macros.md +++ b/src/ch19-06-macros.md @@ -143,11 +143,13 @@ macro with `vec![1, 2, 3];`, the code generated that replaces this macro call will be the following: ```rust,ignore -let mut temp_vec = Vec::new(); -temp_vec.push(1); -temp_vec.push(2); -temp_vec.push(3); -temp_vec +{ + let mut temp_vec = Vec::new(); + temp_vec.push(1); + temp_vec.push(2); + temp_vec.push(3); + temp_vec +} ``` We’ve defined a macro that can take any number of arguments of any type and can