Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Japanuspus opened this issue Dec 19, 2018 · 1 comment
Closed

Comments

@Japanuspus
Copy link
Contributor

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?

@frewsxcv
Copy link
Member

You hit the nail on the head – feel free to submit a pull request with these changes! Thanks for pointing this out!

Japanuspus added a commit to Japanuspus/rust-by-example that referenced this issue Jan 17, 2019
Japanuspus added a commit to Japanuspus/rust-by-example that referenced this issue Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants