]> git.lizzy.rs Git - rust.git/commitdiff
Fix C macro example
authorStephen (Ziyun) Li <stephen.liziyun@gmail.com>
Sun, 17 Jan 2016 19:56:23 +0000 (14:56 -0500)
committerStephen (Ziyun) Li <stephen.liziyun@gmail.com>
Sun, 17 Jan 2016 19:56:23 +0000 (14:56 -0500)
src/doc/book/macros.md

index 7c8b74bd6495d0f44cf279a4c3daec98faa4b55e..f5a0cd5e2c6a30b9793c39f817fa9e2220ed76a9 100644 (file)
@@ -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);
+    }
 }
 ```