From: Seiichi Uchida Date: Sat, 7 Oct 2017 12:51:15 +0000 (+0900) Subject: Run wrap_str() only when chain_indent is set to "Visual" X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=2b6e50436c6bd8826067a08688c74755d57b7b75;p=rust.git Run wrap_str() only when chain_indent is set to "Visual" --- 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 {