Skip to content

String literal #2206

@ElectricCoffee

Description

@ElectricCoffee

Constantly writing "foo".to_string() and String::from("foo") gets tedious after a while.

So I'm proposing a String literal, it could be something as simple as s"foo", @"foo", or even s!"foo" similar to vec![1, 2, 3].

Pros: String gets less verbose, and it comes across just as clear.

Cons: String gets special treatment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the RFC.breaking-changeThe RFC proposes a breaking change.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions