mrdimidium / nanoid

A tiny, secure, URL-friendly, unique string ID generator for Rust
https://docs.rs/nanoid
MIT License
545 stars 29 forks source link

Update README examples to Rust 2018 edition #18

Closed svenstaro closed 4 years ago

svenstaro commented 4 years ago

I think it makes sense to rock Rust 2018 at this point.

mrdimidium commented 4 years ago

Does this prevent you from using the library in earlier versions of the language?

I would like the library to work in as many versions as possible.

svenstaro commented 4 years ago

The crate itself will still work just fine in older versions of the language (even if this crate uses 2018 edition stuff internally). However, people on 2015 edition will have to add the extern crate stuff back for the imports. I argue, however, that people who are stuck on 2015 edition will definitely know to do that as they have to do this with all their dependencies.

I think leaving those extern crates away makes the README cleaner and removes some redundant information.

Edit: I just noticed you're not specifying an edition in your Cargo.toml. This means this crate is already using 2018 edition as that's the default. I suggest you explicitly define it so it won't be implicitly set.

svenstaro commented 4 years ago

I made a follow-up PR with my suggestion: #21