Run wrap_str() only when chain_indent is set to "Visual"

This commit is contained in:
Seiichi Uchida 2017-10-07 21:51:15 +09:00
parent 02ef2ee8de
commit 2b6e50436c

View 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 {