Skip to content

Only reorder module declarations #2484

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

Closed
wants to merge 2 commits into from

Conversation

topecongiro
Copy link
Contributor

Closes #2482.

@topecongiro topecongiro reopened this Feb 24, 2018
@@ -233,7 +233,7 @@ impl ReorderableItemKind {
match item.node {
_ if contains_macro_use_attr(item) => ReorderableItemKind::Other,
ast::ItemKind::ExternCrate(..) => ReorderableItemKind::ExternCrate,
ast::ItemKind::Mod(..) => ReorderableItemKind::Mod,
ast::ItemKind::Mod(ref m) if m.inner.hi() != item.span.hi() => ReorderableItemKind::Mod,
Copy link
Member

Choose a reason for hiding this comment

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

Could you either factor out the test into a function, or add a comment please (it's a bit unclear what the guard is checking for).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is is_mod_decl in items.rs, so I am going to use that.

@topecongiro topecongiro closed this Mar 2, 2018
@topecongiro
Copy link
Contributor Author

I am going to create a new PR with @nrc 's review applied. Thank you for your review!

@topecongiro topecongiro mentioned this pull request Mar 2, 2018
@topecongiro topecongiro deleted the issue-2482 branch July 21, 2019 05:02
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