Skip to content

RFC: Dedented String Literals#3830

Open
nik-rev wants to merge 43 commits into
rust-lang:masterfrom
nik-contrib:dedented_strings
Open

RFC: Dedented String Literals#3830
nik-rev wants to merge 43 commits into
rust-lang:masterfrom
nik-contrib:dedented_strings

Conversation

@nik-rev
Copy link
Copy Markdown

@nik-rev nik-rev commented Jun 5, 2025

Proposal to add dedented string literals to Rust of the form: d"string".

With the following:

let sql = d"
    create table student(
        id int primary key,
        name text
    )
    ";

Being equivalent to:

let sql = "\
create table student(
    id int primary key,
    name text
)";

Rendered

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

Labels

T-lang Relevant to the language team, which will review and decide on the RFC.

Projects

None yet

Development

Successfully merging this pull request may close these issues.