shape,
),
ast::ExprKind::Catch(ref block) => {
- if let rewrite @ Some(_) =
- rewrite_single_line_block(context, "do catch ", block, shape)
+ if let rewrite @ Some(_) = rewrite_single_line_block(context, "do catch ", block, shape)
{
return rewrite;
}
block: &ast::Block,
shape: Shape,
) -> Option<String> {
- if block.stmts.is_empty() && !block_contains_comment(block, context.codemap) &&
- shape.width >= 2
+ if block.stmts.is_empty() && !block_contains_comment(block, context.codemap) && shape.width >= 2
{
return Some("{}".to_owned());
}
let shape = Shape::legacy(context.budget(used_width + offset.width()), offset);
let mut result = try_opt!(rewrite_generics(context, generics, shape, span));
- let same_line_brace = if !generics.where_clause.predicates.is_empty() ||
- result.contains('\n')
- {
+ let same_line_brace = if !generics.where_clause.predicates.is_empty() || result.contains('\n') {
let budget = context
.config
.max_width()
) -> Option<String> {
let skip_count = qself.map_or(0, |x| x.position);
- let mut result =
- if path.is_global() && qself.is_none() && path_context != PathContext::Import {
- "::".to_owned()
- } else {
- String::new()
- };
+ let mut result = if path.is_global() && qself.is_none() && path_context != PathContext::Import {
+ "::".to_owned()
+ } else {
+ String::new()
+ };
let mut span_lo = path.span.lo;
}
ast::ItemKind::Trait(..) => {
self.format_missing_with_indent(item.span.lo);
- if let Some(trait_str) =
- format_trait(&self.get_context(), item, self.block_indent)
+ if let Some(trait_str) = format_trait(&self.get_context(), item, self.block_indent)
{
self.buffer.push_str(&trait_str);
self.last_pos = source!(self, item.span).hi;
foo
}
if ai_timer.elapsed_time().as_microseconds() > ai_time.as_microseconds() {
- if ball.position().y + ball_radius >
- right_paddle.position().y + paddle_size.y / 2.
+ if ball.position().y + ball_radius > right_paddle.position().y + paddle_size.y / 2.
{
foo
}
ha();
} else if xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxx {
yo();
- } else if let Some(x) =
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ } else if let Some(x) = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
ha();
- } else if xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +
- xxxxxxxxx
+ } else if xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxx
{
yo();
}
// Just comments
}
- 'a: while loooooooooooooooooooooooooooooooooong_variable_name + another_value >
- some_other_value
- {}
+ 'a: while loooooooooooooooooooooooooooooooooong_variable_name + another_value > some_other_value
+ {
+ }
while aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb {
}
while aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa {
}
- 'b: for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx in
- some_iter(arg1, arg2)
+ 'b: for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx in some_iter(arg1, arg2)
{
// do smth
}