-
Notifications
You must be signed in to change notification settings - Fork 280
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
2018 edition #222
2018 edition #222
Conversation
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Awesome! Yea I had an other order I maintained import order for a while. Thanks for putting in the work for the arranging them to an other order. I will try to keep that as default, I might want to create some code_style.md. I'm really doubting that we might want to remove the examples from the sub crates and instead use those in /examples, because all those examples are mostly duplicated with the only difference being the namespaces |
Yeah, that's the reason why I just prefixed them with an abbreviation (to fix warnings) and made a separate issue for this. I'm not aiming to solve the examples in this PR. |
Don't merge yet, I've just found that I missed the |
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Okay, I think it's ready for review. Couple of new things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that some of the mod.rs files are removed, and moved a level up. Also, I like that all the crate imports are removed. There is not much to say about the changes, so thanks!
#[cfg(windows)] | ||
use crossterm_utils::supports_ansi; | ||
use crossterm_utils::{impl_display, Command, Result}; | ||
|
||
use crate::{Color, ITerminalColor}; | ||
|
||
use super::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, I like to get rid of those as well, doesn't need to be done in this PR tough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate more? Why to remove crate::...
? Replace super::*
with specific imports to avoid *
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, * is unclear to which types your importing and can create confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll do this. But if you don't mind, in a separate PR, cause this one is mainly about 2018 edition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea totally fine
Signed-off-by: Robert Vojta <[email protected]>
Signed-off-by: Robert Vojta <[email protected]>
Just give the sign and I merge it |
There's no more things to do in this PR. I mean, 2018 edition related. I think it can be merged and comments can be addressed in another PRs. |
2018 edition changes
Cargo.toml
) do containedition = "2018"
extern crate ...
removedWarnings
ONCE_INIT
withOnce::new
crossterm_cursor/examples/cursor.rs
->crossterm_cursor/examples/cc_cursor.rs
Imports
All imports are semantically ordered. The order is:
crate
super
self
mod
I do not expect that everyone is going to maintain this order, but I consider it as a good practice to make the code more readable.
Fixes #213