Skip to content

Plugin does not run rustfmt with correct edition #11

Open
@LPGhatguy

Description

@LPGhatguy

I recently started a new project using Rust's async/await feature, with some code like this:

async fn body() {
    let releases: github::Releases =
        reqwest::get("https://api.github.com/repos/foo/bar/releases")
            .await?
            .json()?;
}

When trying to save my buffer, the RustFmt plugin throws an error and fails to reformat the file because these features are not available in Rust 2015 Edition:

image

The same error can be found by running rustfmt foo.rs directly.

When run on a 2018 edition project, the --edition 2018 argument should be passed to rustfmt. This matches the behavior of cargo fmt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions