Skip to content

Suggest use to_string rather than format!("{}") #8828

Open
@leiysky

Description

@leiysky

What it does

Sometime, people are using format!("{}") to stringify an object, which can be rewritten in .to_string() to keep code clean.

Lint Name

No response

Category

style

Advantage

No response

Drawbacks

No response

Example

let a = format!("{}", x);

Could be written as:

let a = x.to_string();

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions