Struct cargo::ops::fix::FixArgs

source ·
struct FixArgs {
    file: PathBuf,
    prepare_for_edition: Option<Edition>,
    idioms: bool,
    enabled_edition: Option<Edition>,
    other: Vec<OsString>,
    rustc: PathBuf,
    format_args: Vec<String>,
}
Expand description

Various command-line options and settings used when cargo is running as a proxy for rustc during the fix operation.

Fields§

§file: PathBuf

This is the .rs file that is being fixed.

§prepare_for_edition: Option<Edition>

If --edition is used to migrate to the next edition, this is the edition we are migrating towards.

§idioms: bool

true if --edition-idioms is enabled.

§enabled_edition: Option<Edition>

The current edition.

None if on 2015.

§other: Vec<OsString>

Other command-line arguments not reflected by other fields in FixArgs.

§rustc: PathBuf

Path to the rustc executable.

§format_args: Vec<String>

Console output flags (--error-format, --json, etc.).

The normal fix procedure always uses --json, so it overrides what Cargo normally passes when applying fixes. When displaying warnings or errors, it will use these flags.

Implementations§

Validates the edition, and sends a message indicating what is being done. Returns a flag indicating whether this fix should be run.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 104 bytes