summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/configs/indent_style/rfc_control.rs
blob: 6619d8b2630369ac8b6c325f821340116548bb7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// rustfmt-indent_style: Block

// #1618
fn main() {
    loop {
        if foo {
            if ((right_paddle_speed < 0.) && (right_paddle.position().y - paddle_size.y / 2. > 5.))
                || ((right_paddle_speed > 0.)
                    && (right_paddle.position().y + paddle_size.y / 2. < game_height as f32 - 5.))
            {
                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.
                {
                    foo
                }
            }
        }
    }
}

fn issue1656() {
    {
        {
            match rewrite {
                Some(ref body_str)
                    if (!body_str.contains('\n') && body_str.len() <= arm_shape.width)
                        || !context.config.match_arm_blocks()
                        || (extend && first_line_width(body_str) <= arm_shape.width)
                        || is_block =>
                {
                    return None;
                }
                _ => {}
            }
        }
    }
}