Skip to content

Rust 2018 README updates #552

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
Closed

Rust 2018 README updates #552

wants to merge 2 commits into from

Conversation

ralph-mcteggart
Copy link

@ralph-mcteggart ralph-mcteggart commented Jan 19, 2019

Making the example use 2018 behaviour the default.

Here are the changes working in the playground (note 2018 selected):

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=931cef3284f7178eb62554da4a2c035b

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=aaf7f7a741bae6f15de710a16a7340ed

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=619ddc6c95a9a02bd94fd9e19d22c445

Other top 20 crates are updating as well so this is to fall in line. Didn't mention 2015 compatibility as this has largely been ignored elsewhere (except in log crate), with the assumption that anyone on older versions of Rust will know the extern crate syntax.

Having the default 2018 changes in means less friction for new Rustaceans, a lot of whom will only have adopted it post 2018 introduction.

FYI, I can update to include some sort of nod to 2015 if there is a need from the maintainers 👍

Lastly, I noticed docs.rs will still use older syntax. Not sure whether this should be addressed as well. Let me know on merge and I can look into it.

@RReverser
Copy link
Contributor

Having the default 2018 changes in means less friction for new Rustaceans, a lot of whom will only have adopted it post 2018 introduction.

I'm not sure there's that much friction, especially given that current examples are compatible and work in both editions out of the box, while removing extern crate will make it work only in 2018.

@ralph-mcteggart
Copy link
Author

ralph-mcteggart commented Jan 19, 2019

@RReverser can understand your viewpoint but just checking out Rust since 2018 release myself I've found it confusing stumbling across this syntax before being 100% on how it worked. I had put it in some places and not others until I got far enough along on my learning to revisit the 2018 notes.

EDIT: I just think for the top 20 odd crates it's worthwhile having it in sync with "the book" to limit confusion, especially with Rust having a smaller std lib and programmers from other languages taking stuff like regex as part of their standard toolset without using dependencies usually

BurntSushi added a commit that referenced this pull request Mar 30, 2019
This updates the README examples to drop the use of `extern crate`. We
do include instructions to add it, but only for Rust 2015.

Closes #552
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