Skip to content

Suspicious formatting with string literals in macros #5855

Description

@JaniM

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

Activity

  1. calebcartwright commented on Jul 22, 2023

    @calebcartwright
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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