Skip to content

align strings when trailing backslash is used #1026

Closed
@nikomatsakis

Description

@nikomatsakis

Rust has this nifty feature that a trailing backslash ignores leading whitespace on the next line when found in a string constant. This means that if I have a Rust source file like:

fn main() {
    println!("foo\
bar");
}

I can instead indent it like:

fn main() {
    println!("foo\
              bar");
}

But rustfmt doesn't do this, from what I can tell. Perhaps we ought to?

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