]> git.lizzy.rs Git - rust.git/commitdiff
Run wrap_str() only when chain_indent is set to "Visual"
authorSeiichi Uchida <seuchida@gmail.com>
Sat, 7 Oct 2017 12:51:15 +0000 (21:51 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Sat, 7 Oct 2017 12:55:04 +0000 (21:55 +0900)
src/chains.rs

index d5016d8db268370bcb9b231eeb4e21996ddff159..30a9444d4ae7ec7e999cf138e2d9bd2a8d34772b 100644 (file)
@@ -266,7 +266,11 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
         )
     };
     let result = format!("{}{}", result, repeat_try(suffix_try_num));
-    wrap_str(result, context.config.max_width(), shape)
+    if context.config.chain_indent() == IndentStyle::Visual {
+        wrap_str(result, context.config.max_width(), shape)
+    } else {
+        Some(result)
+    }
 }
 
 fn is_extendable_parent(context: &RewriteContext, parent_str: &str) -> bool {