From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../target/configs/indent_style/rfc_control.rs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/tools/rustfmt/tests/target/configs/indent_style/rfc_control.rs (limited to 'src/tools/rustfmt/tests/target/configs/indent_style/rfc_control.rs') diff --git a/src/tools/rustfmt/tests/target/configs/indent_style/rfc_control.rs b/src/tools/rustfmt/tests/target/configs/indent_style/rfc_control.rs new file mode 100644 index 000000000..6619d8b26 --- /dev/null +++ b/src/tools/rustfmt/tests/target/configs/indent_style/rfc_control.rs @@ -0,0 +1,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; + } + _ => {} + } + } + } +} -- cgit v1.2.3