Skip to content

"To and from Strings"-section recommends ToString in conflict with the book #1131

@Japanuspus

Description

@Japanuspus

The "To and from Strings"-section recommends implementing the ToString-trait directly 1. According to the docs, best practice is to not implement this trait directly, but rather to implement the fmt::Display trait.

Related, the section on the fmt::Display trait does not mention that implementing fmt::Display gives ToString for free.

I suggest to replace the "To String" section in "To and from Strings" with an example of this approach, and to include a link to this section from the existing section on fmt::Display.

Should I submit a pull-request to this effect, or have I missed something?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions