Skip to content

fix: better Fn traits formatting #10823

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

Merged
merged 1 commit into from
Nov 21, 2021
Merged

fix: better Fn traits formatting #10823

merged 1 commit into from
Nov 21, 2021

Conversation

veber-alex
Copy link
Contributor

This makes it so formatting Fn traits properly handles:

  1. An Fn trait with only a single argument -> removes the trailing comma.
  2. An Fn trait which returns nothing (an empty tuple) -> don't show -> () as the return type.

before:
before

after:
after

@jonas-schievink
Copy link
Contributor

Thanks!

bors r+

@jonas-schievink
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 21, 2021

@bors bors bot merged commit 183ef04 into rust-lang:master Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants