How to format Rust code "on save" in VSCODE

This article was published on Apr 19, 2021

For some reason, when we install Rust VSCODE extension the formatter does not work by default. To do that I we need to enforce the formatter via settings.json (or User preference)

    "[rust]": {
        "editor.defaultFormatter": "rust-lang.rust", // Makes the magic
        "editor.formatOnSave": true // Optional