Skip to content

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