Skip to content

[perf] proc-macro Ident should have method as_str #139953

@loynoir

Description

@loynoir

According to https://doc.rust-lang.org/proc_macro/struct.Ident.html

There are

  • pub fn new(string: &str, span: Span) -> Ident

  • ident.to_string()

Should provide below for performance

  • ident.as_str()

Very common actual usage

ident_string = ident.to_string()

match ident_string.as_str() { ... }

Expect usage

match ident.as_str() { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-proc-macrosArea: Procedural macrosC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions