about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStephen (Ziyun) Li <stephen.liziyun@gmail.com>2016-01-17 14:56:23 -0500
committerStephen (Ziyun) Li <stephen.liziyun@gmail.com>2016-01-17 14:56:23 -0500
commit8a829704cb28544dd13c3de831cf822da17e5bf0 (patch)
treeacca3f0cd454939d422f7f0922d8fad620d4c746
parentbff52927f582e2ca8dea799bd58f06e654295e21 (diff)
downloadrust-8a829704cb28544dd13c3de831cf822da17e5bf0.tar.gz
rust-8a829704cb28544dd13c3de831cf822da17e5bf0.zip
Fix C macro example
-rw-r--r--src/doc/book/macros.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/doc/book/macros.md b/src/doc/book/macros.md
index 7c8b74bd649..f5a0cd5e2c6 100644
--- a/src/doc/book/macros.md
+++ b/src/doc/book/macros.md
@@ -285,9 +285,11 @@ This expands to
 
 ```text
 const char *state = "reticulating splines";
-int state = get_log_state();
-if (state > 0) {
-    printf("log(%d): %s\n", state, state);
+{
+    int state = get_log_state();
+    if (state > 0) {
+        printf("log(%d): %s\n", state, state);
+    }
 }
 ```