Skip to content

Can't format the string containing multiple | #6672

@lamualfa

Description

@lamualfa

Read the comment on the playground for reproduction:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=e1ec47f36edbbe3b40078d2a186f9f4c

// This is unformatted code
// Run Rustfmt on Tools to test the issue

fn main() {
    // Rustfmt handle these lines correctly
    let sample1=http_client.post(config.portal_api.base_url.join("login").unwrap())
        .json(&login_request_body).send().await.unwrap();
        
    // Rustfmt can't format these lines
    let sample2=http_client.post(config.portal_api.base_url.join("login").unwrap())
        .header("api-info", "V2|appVerson|deviceBrand|deviceModel|deviceScreenResolution|deviceOs|deviceOsVersion|deviceNetworkProvider|deviceNetworkType")
        .json(&login_request_body).send().await.unwrap();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions