By default, the VS Code extension rust-analyzer will run cargo check
on save. If you want to have warnings and errors from Clippy to show instead, change the command to clippy
in your settings.json
:
"rust-analyzer.checkOnSave.command": "clippy"
Credit goes to 17cupsofcoffee for the solution.