-
Notifications
You must be signed in to change notification settings - Fork 974
Open
Labels
C-feature-requestCategory: a feature request (not decided/implemented)Category: a feature request (not decided/implemented)P-lowLow priorityLow prioritycommunity drivenIssues the rustfmt team will not work on directly. Intended for contributors!Issues the rustfmt team will not work on directly. Intended for contributors!
Description
I ended up writing this feature request formatted like the Rustfmt options docs. Please let me know if more information is needed or if I somehow missed that this option already exists.
fn_chain_vertical_semicolon
Vertically wrap the semicolon at the end of a vertical function chain.
Pros
- Easier to visually scan the leftmost character to see when the method calls stop and the semicolon ends the statement.
- IDEs that support single-line commenting don't have to be corrected after commenting out the last line.
- e.g. in the
falseexample, an IDE may replace.dolor();with// .dolor();and comment out the semicolon causing an error.
- e.g. in the
Cons
- Adds a basically empty line, making code taller than necessary.
- Default: I don't know how this is decided. As it is currently unimplemented, the default is
false. - Possible Values:
true,false
false:
fn main() {
lorem
.ipsum()
.dolor();
}true:
fn main() {
lorem
.ipsum()
.dolor()
;
}Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: a feature request (not decided/implemented)Category: a feature request (not decided/implemented)P-lowLow priorityLow prioritycommunity drivenIssues the rustfmt team will not work on directly. Intended for contributors!Issues the rustfmt team will not work on directly. Intended for contributors!