cargo Verified current stable Not installed? Package Management

Cargo / Fix Code Allow Dirty

Fix Code Allow Dirty

Use 'cargo fix --allow-dirty' to automatically fix Rust code without requiring a clean working directory.

$
Terminal
cargo fix --allow-dirty

When To Use

You need to fix Rust code while having uncommitted changes in your workspace.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Fixing code in the current package...

    Fixed 5 issues in 3 files.

Run 'git status' to see changes.

Command Breakdown

What each part is doing

cargo
Base Command
The executable that performs this operation. Here it runs Cargo before the shell applies any redirect operators.
--allow-dirty
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Run the command: `cargo fix --allow-dirty`

  2. Step 2

    Check the changes with: `git status`.

Alternative Approaches

Comparable commands in other tools

Alternative package management tools for the same job.