Intentions and quick-fixes
When RustRover finds a way to fix, improve, or optimize your code, it displays either a yellow bulb icon (intention suggested) or a red bulb with an exclamation mark (quick-fix suggested) in the editor next to the corresponding line.
Apply a quick fix/intention
Hover over the problematic code and press Alt+Enter (or click /).
Select the preferred action from the list.
A few examples of Rust-specific intentions and quick-fixes are given below.
The Add missing fields quick-fix helps you interactively define field values of struct literals:
You can quickly add
implblocks for structs and enums, and perform struct-to-tuple and tuple-to-struct conversion:
For all unresolved references in your code, there's a handy auto-import quick-fix:
matchexpressions in your code and suggests removing unreachable patterns and adding the missing ones, which includes the cases of complex patterns with multiple types. This inspection also supports match ergonomics.
You can find the full list of Rust intentions and adjust them if necessary in: