Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Order of imports and order of trait bounds #28

Open
gsingh93 opened this issue Aug 21, 2014 · 2 comments
Open

Order of imports and order of trait bounds #28

gsingh93 opened this issue Aug 21, 2014 · 2 comments

Comments

@gsingh93
Copy link

I'm not sure if this getting too nitpicky, but should the style guide include suggestions for the order of imports and the order of trait arguments? In my own code, I organize them both alphabetically. It'd be nice to see this in other peoples' code as well.

@gsingh93 gsingh93 changed the title Order of imports and order of trait arguments Order of imports and order of trait bounds Aug 21, 2014
@nathantypanski
Copy link
Contributor

The current guide suggests order based on qualities of the imports.

Are you suggesting ordering these subsections alphabetically? I think that makes more sense than going alphabetically all-around.

The current standard (specifying higher-level categories but not exact ordering within them) appears to be the direction of Pep8. I personally would prefer to give people the freedom to order subsections on a projecty-by-project basis, rather than specifying it in the guidelines. YMMV.

@gsingh93
Copy link
Author

Yea, I was suggesting alphabetically ordering imports inside subsections.

For traits I was thinking this should be considered good style:

fn foo<T: Clone + Default>();

Where as this would be considered bad style:

fn foo<T: Default + Clone>();

I'd like to see more opinions on both of these topics.

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

No branches or pull requests

2 participants