Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

align strings when trailing backslash is used #1026

Closed
nikomatsakis opened this issue May 31, 2016 · 3 comments
Closed

align strings when trailing backslash is used #1026

nikomatsakis opened this issue May 31, 2016 · 3 comments

Comments

@nikomatsakis
Copy link

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?

@marcusklaas
Copy link
Contributor

We used to do this by default, but we have disabled it because it often did not do the right thing.. I'm sure there's a configuration option for this.

@nikomatsakis
Copy link
Author

@marcusklaas hmm, are there older issues yo can point me at? in what way could it not do the right thing? it seems like if people don't want the strings aligned, they should not use \...

@topecongiro
Copy link
Contributor

Closed via #1724.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants