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

Suspicious formatting with string literals in macros #5855

Closed
JaniM opened this issue Jul 22, 2023 · 1 comment
Closed

Suspicious formatting with string literals in macros #5855

JaniM opened this issue Jul 22, 2023 · 1 comment

Comments

@JaniM
Copy link

JaniM commented Jul 22, 2023

This isn't exactly a bug, but I feel the behavior is highly unexpected.

let _style = css!("
    display: flex;
    flex-direction: column;
    ...
");

formats to

let _style = css!(
    "
    display: flex;
    flex-direction: column;
    ...
"
);

I much prefer the original code.
Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2e601d5bbc9f0103bf217f469c6dc0a1

@calebcartwright
Copy link
Member

Thanks for sharing but going to close as this isn't a bug. You may want to follow rust-lang/rfcs#3450 if you aren't already, as it contains some available alternatives for the string arg as well as proposed lang addition that would support these types of scenarios in a new way.

@calebcartwright calebcartwright closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2023
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

2 participants