-
Notifications
You must be signed in to change notification settings - Fork 907
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
rustfmt deletes vertical bar for match branches! #2462
Comments
The stabilization PR removed |
Note that rustfmt will not remove the vertical bar at the beginning of march arms, but it will not format the entire arm with the beginning vertical bar. @rusterize Would you tell us which version of rustfmt you are using please? I think you might be using older version of rustfmt. |
|
@rusterize Thanks! You are using the latest rustfmt, so I assume that the removal of the vertical bar happens in non-simple cases. Could you please share your code that caused the removal of the vertical bar? |
Before rustfmt: match anchor {
| &Some(ref row_index) => Ok(row_nodes_borrow
.get(row_index)
.ok_or(RowIndexNotFound(format!("{}", row_index)))?),
| &None => Ok(&self.root_node_iter),
} after rustfmt: match anchor {
&Some(ref row_index) => Ok(row_nodes_borrow
.get(row_index)
.ok_or(RowIndexNotFound(format!("{}", row_index)))?),
|
&None => Ok(&self.root_node_iter),
} |
@rusterize Thank you for sharing the code! I could confirm the issue. And it should be fixed with #2464. |
I'm not 100% sure what Rustfmt should be doing here, see rust-lang/style-team#119, however, it is clear the current behaviour is bad so I've merged the fixing PR. |
The vertical bar for match brances was just stabilized, but
rustfmt
deletes them.Thanks for the great work.
The text was updated successfully, but these errors were encountered: