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

Change : ToString to : Into<String>. #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fee1-dead
Copy link

@fee1-dead fee1-dead commented Apr 21, 2022

The rationale is that if the user already has a String, using
ToString will unnecessarily clone the String instead of assigning it
directly.

If you want, this can be done without a breaking change (i.e. keeping existing methods and adding new ones to support setting a string directly), but I'd argue that adds too much complexity to the API.

The rationale is that if the user already has a `String`, using
`ToString` will unnecessarily clone the `String` instead of assigning it
directly.
@ISSOtm
Copy link
Contributor

ISSOtm commented May 23, 2024

Unfortunately, doing so would lose the ability to use any type that e.g. implements Display. I'm not sure that's great?

@fee1-dead
Copy link
Author

Display should be explicit because it might be expensive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants