Usage

Let's consider moving the project from Edition 2015 to Edition 2018. Which arguments do you have to set to do this transformation of your code? First, you can prepare your code for transformation with this command:

cargo fix --edition

This command will make your code compatible with both editions, but if you want to use idioms of an edition, you have to set the edition version to be used in the edition field of the [package] section of the Cargo.toml file, and run the following command:

cargo fix --edition-idioms

After running this, your code will potentially be compatible with the selected edition. You can also do more with rustfix, but some issues can be fixed if you use an IDE, but this topic is out of the scope of this book; and let's explore other cargo commands.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.131.255