Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line break missing with indent_style = "Visual" #4026

Open
YaLTeR opened this issue Jan 23, 2020 · 1 comment
Open

Line break missing with indent_style = "Visual" #4026

YaLTeR opened this issue Jan 23, 2020 · 1 comment
Labels
only-with-option requires a non-default option value to reproduce p-low poor-formatting

Comments

@YaLTeR
Copy link
Contributor

YaLTeR commented Jan 23, 2020

The following code is formatted as follows with rustfmt 1.4.11-nightly (1838235 2019-12-03) and also rustfmt 2.0.0-rc.1-nightly (facba6a5 2020-01-14):

fn main() {
    let global_manager = GlobalManager::new_with_cb(&display,
                                                    global_filter!([WlSeat,
                                                   2,
                                                   move |seat: Main<WlSeat>, _: DispatchData| {
                                                       let seat_data =
                                                           RefCell::new(SeatData::default());
                                                       seat.as_ref()
                                                           .user_data()
                                                           .set(move || seat_data);
                                                       seat.quick_assign(seat_handler);
                                                       seats_2.borrow_mut().push(seat);
                                                   }]));
}

Looks like it forgets to break the line after =, inserting the line break gives the desired result:

fn main() {
    let global_manager =
        GlobalManager::new_with_cb(&display,
                                   global_filter!([WlSeat,
                                                   2,
                                                   move |seat: Main<WlSeat>, _: DispatchData| {
                                                       let seat_data =
                                                           RefCell::new(SeatData::default());
                                                       seat.as_ref()
                                                           .user_data()
                                                           .set(move || seat_data);
                                                       seat.quick_assign(seat_handler);
                                                       seats_2.borrow_mut().push(seat);
                                                   }]));
}
@topecongiro topecongiro added only-with-option requires a non-default option value to reproduce p-low poor-formatting labels Jun 29, 2020
@ytmimi
Copy link
Contributor

ytmimi commented Jul 26, 2022

Linking tracking issue for indent_style #3346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
only-with-option requires a non-default option value to reproduce p-low poor-formatting
Projects
None yet
Development

No branches or pull requests

3 participants