Skip to content

Redundant to_string? #7729

Closed
Closed
@smoelius

Description

@smoelius

I was surprised that there does not seem to be a lint to catch the following. Is it possible that it exists and I am somehow not triggering it?

use camino::Utf8PathBuf;

fn main() {
    let path = Utf8PathBuf::from("src/main.rs");
    println!("{}", path.to_string()); // to_string is unnecessary since Utf8PathBuf implements Display
    println!("{}", path);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions