Skip to content

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Mar 19, 2016

Indoc takes a string literal and un-indents it so the leftmost non-space character is in the first column. Let me know whether you think this is valuable.

Before:

concat!(
    "[\n",
    "  false,\n",
    "  null,\n",
    "  [\n",
    "    \"foo\\nbar\",\n",
    "    3.5\n",
    "  ]\n",
    "]"
)

After:

indoc!(r#"
    [
      false,
      null,
      [
        "foo\nbar",
        3.5
      ]
    ]"#
)

@erickt erickt merged commit 27f4457 into serde-rs:master May 12, 2016
@erickt
Copy link
Member

erickt commented May 12, 2016

Neat! That does look a lot cleaner now!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants