5 ms·
These seem pretty minimal. Most of the code I can recall writing or have seen would require no changes or maybe a one liner here and there.
by api 5y ago
These seem pretty minimal. Most of the code I can recall writing or have seen would require no changes or maybe a one liner here and there.
- nindalf 5y agoThe 2018 edition came with tools to automate the migration. I imagine most of these changes will be fully automated as well.
- raphlinus 5y agoI think that's a good thing. People do complain about the overly high rate of evolution of Rust, but I think that was much more true in previous years than today (not least because a lot of projects needed to depend on nightly). Also, most of these changes enable new things, and are only in the edition because of some low chance of breaking existing code. The 2018 edition had some major changes, so 2018 code looks pretty different - the ? operator, big changes to module use, impl/dyn Trait, and more. I suspect that most code bases you won't be able to tell whether it's 2018 or 2021 without looking more closely.
- chrismorgan 5y agoI expect a common complaint to be “why isn’t [].into_iter() working in my tests? —oh, it’s 2018 edition”, though this can be mitigated by a specialised error message which didn’t exist last week when I first learned about this matter.
- ckok 5y agoBut that's the right way to do it really... I remember an obscure thing in c# when var was introduced that if you have a type called 'var' in scope, type inference doesn't work and it uses that type instead. This is the way new features should be introduced.