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

rustfmt putting space between first and second tuple element indexing. is this intended? #5532

Closed
bindsdev opened this issue Sep 4, 2022 · 2 comments

Comments

@bindsdev
Copy link

bindsdev commented Sep 4, 2022

I noticed that rustfmt, in some cases when using tuple indexing back to back such as some_tuple.0.0 (some_tuple.0 being another tuple or tuple struct of course), it would reformat it to some_tuple.0 .0. Is this behavior intended? If so, I would like an explanation on why rustfmt decides to format it this way.

Examples

Prior to running cargo fmt:

match self.peek().1.0 {
    ...
}
match self.advance().1.0 {
    ...
}
if self.peek().1.0 == expected {
   ...
}

After running cargo fmt:

match self.peek().1 .0 {
    ...
}
match self.advance().1 .0 {
    ...
}
if self.peek().1 .0 == expected {
   ...
}
@calebcartwright
Copy link
Member

Please see - #4355 (comment)

@calebcartwright calebcartwright closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2022
@bindsdev
Copy link
Author

bindsdev commented Sep 4, 2022

Please see - #4355 (comment)

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants