cargo fix

Automatically fix lint warnings reported by rustc

Options

NameDescription
-p, --package <package...>
  • Repeatable ♾
--exclude <exclude>
  • Repeatable ♾
-j, --jobs <jobs>Number of parallel jobs, defaults to # of CPUs
--bin <bin...>
  • Repeatable ♾
--example <example...>
  • Repeatable ♾
--test <test...>
  • Repeatable ♾
--bench <bench...>
  • Repeatable ♾
--profile <profile>Build artifacts with the specified profile
--features <features...>
  • Repeatable ♾
--target <target>
  • Repeatable ♾
--target-dir <target-dir>Directory for all generated artifacts
--manifest-path <manifest-path>Path to Cargo.toml
--message-format <message-format>
  • Repeatable ♾
--color <color>Coloring: auto, always, never
--config <config>
  • Repeatable ♾
-Z <unstable-features>
  • Repeatable ♾
-q, --quietDo not print cargo log messages
--workspaceFix all packages in the workspace
--allAlias for --workspace (deprecated)
--libFix only this package's library
--binsFix all binaries
--examplesFix all examples
--testsFix all tests
--benchesFix all benches
--all-targetsFix all targets (default)
-r, --releaseFix artifacts in release mode, with optimizations
--all-featuresActivate all available features
--no-default-featuresDo not activate the `default` feature
--broken-codeFix code even if it already has compiler errors
--editionFix in preparation for the next edition
--edition-idiomsFix warnings to migrate to the idioms of an edition
--allow-no-vcsFix code even if a VCS was not detected
--allow-dirtyFix code even if the working directory is dirty
--allow-stagedFix code even if the working directory has staged changes
--ignore-rust-versionIgnore `rust-version` specification in packages
-h, --helpPrint help information
-v, --verbose
  • Repeatable ♾
--frozenRequire Cargo.lock and cache are up to date
--lockedRequire Cargo.lock is up to date
--offlineRun without accessing the network
--timingsTiming output formats (unstable)