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
, usingToString
will unnecessarily clone theString
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.