-
Notifications
You must be signed in to change notification settings - Fork 974
Open
Labels
A-call-chainsArea: method call chainsArea: method call chainsI-poor-formattingIssue: poor formattingIssue: poor formattingP-lowLow priorityLow priority
Milestone
Description
In the following example, the first long method call chain is kept at the outer indentation level, while the second is indented by one:
fn very_very_very_very_very_long_fun_name(x: i32) -> Vec<i32> {
vec![x]
}
fn main() {
let very_very_very_very_very_very_very_very_very_long_var_name = 13;
let all = very_very_very_very_very_long_fun_name(
very_very_very_very_very_very_very_very_very_long_var_name,
)
.iter()
.map(|x| x + very_very_very_very_very_very_long_var_name);
let more = 13;
let other = vec![1, 2, 3]
.iter()
.map(|x| x + very_very_very_very_very_very_long_var_name);
}I think the first chain is formatted quite badly; everything that's part of let all should be indented by one to indicate that it is part of the same statement.
ozkriff, stanislav-tkach, quasiyoke, Boscop, arsen-ch and 15 more
Metadata
Metadata
Assignees
Labels
A-call-chainsArea: method call chainsArea: method call chainsI-poor-formattingIssue: poor formattingIssue: poor formattingP-lowLow priorityLow priority