Skip to content

fmt! could be optimized for some combinations of arguments #6035

@Kimundi

Description

@Kimundi

There are at least two cases where fmt! could perform an early optimization:

  • fmt!("...") could expand to the same code as an ~"..." string literal.
  • fmt!("%s", s) could expand to s

Both optimizations seem unnecessary on their own (why call fmt! at all?), but might be useful considering that certain core macros use fmt! internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensionsI-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions