Skip to content

Conversation

@sanxiyn
Copy link
Contributor

@sanxiyn sanxiyn commented Dec 11, 2015

cc #442.

Instead of saying "without trailing semicolon", show the replacement without trailing semicolon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the snippet is None?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, we said "Consider using ..", which is nonsense. Now we say "unneeded return statement", without a suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine, but we could do even better by defaulting to a suggestion to remove the return and semicolon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, maybe later.

I note that currently we say "without trailing semicolon" even when there is no trailing semicolon. I don't think the current message is very good.

Manishearth added a commit that referenced this pull request Dec 17, 2015
Use suggestion for needless_return
@Manishearth Manishearth merged commit b900e88 into rust-lang:master Dec 17, 2015
@sanxiyn sanxiyn deleted the suggestion-2 branch December 18, 2015 04:04
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.

3 participants