From 97843377ee507bf15fd0c195c2604ea39c342db0 Mon Sep 17 00:00:00 2001 From: Kevin Stenerson Date: Thu, 8 Nov 2018 19:26:12 -0700 Subject: [PATCH] Replace always true conditionals with `true` --- src/expr.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/expr.rs b/src/expr.rs index 502c42ff213f..aea5fa5f96fe 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1340,24 +1340,18 @@ pub fn can_be_overflowed_expr(context: &RewriteContext, expr: &ast::Expr, args_l | ast::ExprKind::WhileLet(..) => { context.config.combine_control_expr() && context.use_block_indent() && args_len == 1 } - ast::ExprKind::Block(..) | ast::ExprKind::Closure(..) => { - context.use_block_indent() || context.config.indent_style() == IndentStyle::Visual - } + + // Handle always block-like expressions + ast::ExprKind::Block(..) | ast::ExprKind::Closure(..) => true, // Handle `[]` and `{}`-like expressions ast::ExprKind::Array(..) | ast::ExprKind::Struct(..) => { - if context.config.overflow_delimited_expr() { - context.use_block_indent() || context.config.indent_style() == IndentStyle::Visual - } else { - context.use_block_indent() && args_len == 1 - } + context.config.overflow_delimited_expr() + || (context.use_block_indent() && args_len == 1) } ast::ExprKind::Mac(ref macro_) => { match (macro_.node.delim, context.config.overflow_delimited_expr()) { - (ast::MacDelimiter::Bracket, true) | (ast::MacDelimiter::Brace, true) => { - context.use_block_indent() - || context.config.indent_style() == IndentStyle::Visual - } + (ast::MacDelimiter::Bracket, true) | (ast::MacDelimiter::Brace, true) => true, _ => context.use_block_indent() && args_len == 1, } }