]> git.lizzy.rs Git - rust.git/commitdiff
Do not set inside_macro flag when converting try!() to '?'
authorSeiichi Uchida <seuchida@gmail.com>
Sun, 10 Dec 2017 12:53:01 +0000 (21:53 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Sun, 10 Dec 2017 12:53:01 +0000 (21:53 +0900)
This will keep rustfmt idempotent when using 'use_try_shorthand' config option.

src/macros.rs

index 3c5db3c977abf1ccfb25b30faa5f259824578dce..731ebd5adfc92a1704137ac326acfb690b29778c 100644 (file)
@@ -118,6 +118,7 @@ pub fn rewrite_macro(
     context.inside_macro = true;
     if context.config.use_try_shorthand() {
         if let Some(expr) = convert_try_mac(mac, context) {
+            context.inside_macro = false;
             return expr.rewrite(context, shape);
         }
     }