ariadne icon indicating copy to clipboard operation
ariadne copied to clipboard

Change `: ToString` to `: Into<String>`.

Open fee1-dead opened this issue 3 years ago • 2 comments

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.

fee1-dead avatar Apr 21 '22 06:04 fee1-dead

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

ISSOtm avatar May 23 '24 13:05 ISSOtm

Display should be explicit because it might be expensive.

fee1-dead avatar May 23 '24 13:05 fee1-dead