Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

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

Open
fee1-dead wants to merge 1 commit intozesterer:mainfrom
fee1-dead-contrib:change-bounds
Open

Change : ToString to : Into<String>.#31
fee1-dead wants to merge 1 commit intozesterer:mainfrom
fee1-dead-contrib:change-bounds

Conversation

@fee1-dead
Copy link
Copy Markdown

@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
Copy Markdown
Collaborator

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
Copy Markdown
Author

Display should be explicit because it might be expensive.

@zesterer zesterer force-pushed the main branch 2 times, most recently from 2f36bc2 to 4b3807c Compare December 13, 2025 21:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants