From 2b6e50436c6bd8826067a08688c74755d57b7b75 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Sat, 7 Oct 2017 21:51:15 +0900 Subject: [PATCH] Run wrap_str() only when chain_indent is set to "Visual" --- src/chains.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chains.rs b/src/chains.rs index d5016d8db26..30a9444d4ae 100644 --- a/src/chains.rs +++ b/src/chains.rs @@ -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 { -- 2.44.0