Some(format!("break{}", id_str))
}
}
- ast::ExprKind::Yield(ref opt_expr) => if let Some(ref expr) = *opt_expr {
- rewrite_unary_prefix(context, "yield ", &**expr, shape)
- } else {
- Some("yield".to_string())
- },
+ ast::ExprKind::Yield(ref opt_expr) => {
+ if let Some(ref expr) = *opt_expr {
+ rewrite_unary_prefix(context, "yield ", &**expr, shape)
+ } else {
+ Some("yield".to_string())
+ }
+ }
ast::ExprKind::Closure(capture, asyncness, movability, ref fn_decl, ref body, _) => {
closures::rewrite_closure(
capture, asyncness, movability, fn_decl, body, expr.span, context, shape,
false,
true,
mk_sp(else_block.span.lo(), self.span.hi()),
- ).rewrite(context, shape)
+ )
+ .rewrite(context, shape)
}
ast::ExprKind::If(ref cond, ref if_block, ref next_else_block) => {
ControlFlow::new_if(
false,
true,
mk_sp(else_block.span.lo(), self.span.hi()),
- ).rewrite(context, shape)
+ )
+ .rewrite(context, shape)
}
_ => {
last_in_chain = true;
new_indent.to_string(context.config),
line.trim_left()
)
- }).collect::<Vec<_>>()
+ })
+ .collect::<Vec<_>>()
.join("\n")
.trim_left(),
);
.offset_left(offset)
.and_then(|shape| shape.sub_width(1 + rhs_overhead))
} else {
- shape.visual_indent(offset).sub_width(offset + 1)
+ match context.config.indent_style() {
+ IndentStyle::Block => shape
+ .offset_left(offset)
+ .and_then(|shape| shape.sub_width(1)),
+ IndentStyle::Visual => shape.visual_indent(offset).sub_width(offset + 1),
+ }
};
let orig_index_rw = index_shape.and_then(|s| index.rewrite(context, s));